cancel
Showing results for 
Search instead for 
Did you mean: 

How to access subnode attributes of value node elements

Former Member
0 Kudos

Hi together,

today i am facing the follwing problem:

My context node looks like this:

VALUE NODE A

.........|----


VALUE NODE B

.........|..................|----


Attribute 1

.........|................. |----


Attribute 2

.........|---Attribute 3

.........|---Attribute 4

.........|

...

cardinality node A is 0..n

cardinality node B is 0..1

Now I want to iterate over all Elements of node A and read Attribute 1 and 2 of the sub node B of every element and write them into a seperate node.

I have no idea how to access value node B while iterating over the parent node and i hope you can help me.

Thanks in advance.

RoM

Edited by: RoM_12 on Sep 22, 2010 2:06 PM

Edited by: RoM_12 on Sep 22, 2010 2:07 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can access the NodeB as like NodeA, you can refer following code


    for(int i=0;i<wdContext.nodeNodeA().size();i++)
    {
    	wdContext.nodeNodeA().moveTo(i);
    	..... = wdContext.currentNodeBElement().getAttr1();
	..... = wdContext.currentNodeBElement().getAttr2();
    	..... = wdContext.currentNodeAElement().getAttr3();
	..... = wdContext.currentNodeAElement().getAttr4();
    }

Thats all.

Try this way can help you:)

Former Member
0 Kudos

That's it. I knew I have to solve it by using the lead selection....somehow

Thanks for your help Sheik.Mohamed.Rafiq!

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos

value node B is singleton or nonsingleton?

Former Member
0 Kudos

It's a singleton. (model node)

Edited by: RoM_12 on Sep 22, 2010 3:47 PM