on 09-22-2010 1:03 PM
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
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:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
value node B is singleton or nonsingleton?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.