cancel
Showing results for 
Search instead for 
Did you mean: 

how to set all values in a node

Former Member
0 Kudos

Hello,

I have a code that looks like

wdContext.currentTestCtxElement.setValue1(null);

wdContext.currentTestCtxElement.setValue2(null);

wdContext.currentTestCtxElement.setValue3(null);

and so on..

is there a way to loop through it and set same values dynamically?

regards,

arnold

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the following code

Iterator itr1 = wdContext.getChildNode("<Your Node>",0).getNodeInfo().iterateAttributes();

while(itr1.hasNext())

{

IWDAttributeInfo iWDInfo = (IWDAttributeInfo) itr1.next();

wdContext.getChildNode("<YourNode>",0).getCurrentElement().setAttributeValue(iWDInfo.getName(),"<value>");

}

Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapparaj,

Thanks for the reply. It worked. Thanks a lot.

regards,

arnold

Answers (0)