on 05-15-2005 11:56 AM
Hello,
I have a Context Node myNode which contains many attributes: first_name, last_name, phone ect.
How do I go over the Node in a while/for loop and query each attribute for it's value for example?
Hi Roy,
wdThis.wdGetContext().getNodeInfo().iterateAttributes();
wil give u the iterator .. Then its all the the same.it.next() will give u the element.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Roy,
Hope this will suffice.
Iterator it = wdThis.wdGetContext().getNodeInfo().iterateAttributes();
IWDAttributeInfo attributeInfo = (IWDAttributeInfo)it.next();
wdContext.currentContextElement().getAttributeValue(attributeInfo.getName());
wdComponentAPI.getMessageManager().reportWarning( ""+ wdContext.currentContextElement().getAttributeValue(attributeInfo.getName()));
regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
wdContext.node<<Node>>().getElementAt().getAttributeValue()
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try something like this:
public static void iterateThroughAttributes(final IWDNode node)
{
final int size = node.size();
final IWDNodeInfo nodeInfo = node.getNodeInfo();
for (int i = 0; i< size; i++)
{
final IWDNodeElement element = node.getElementAt( i );
for (final Iterator it = nodeInfo.iterateAttributes(); it.hasNext(); )
{
final IWDAttributeInfo attributeInfo = (IWDAttributeInfo)it.next();
element.getAttributeValue( attributeInfo.getName() );
}
}
}
Regards, Maxim R.
Message was edited by: Armin Reichert
corrected code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.