cancel
Showing results for 
Search instead for 
Did you mean: 

how to set and get attribute values of childnode

former_member219446
Participant
0 Kudos

Hi experts,

i have node A (0..n)

--attrb1

--attrb2

-- node B (childnode) (0..n)

--attrb3

--attrb4

at runtime node A element contains muliple node B child elements

how to set attribute values to node B and how to get the node B attribute valuess ot parent node A

Thanks & Regards,

Srinivas.

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi,

Refer to the links below:

Regards,

Poojith MV

former_member219446
Participant
0 Kudos

Hi Poojith,

Thank you for your response, its very helpful

Regards,

Srinivas

former_member219446
Participant
0 Kudos

Hi,

Getting the attribute values process is ok.

could you help on setting the attribute values to child node .

Thanks & Regards,

Srinivas

Former Member
0 Kudos

Hi srinivas,

Considering the senario you have given the below code can be used to populate the node A

IPrivate<View>.INodeAElement elNodeAElement = null;
elNodeAElement = wdContext.nodeNodeA().createAndAddNodeAElement();
elNodeAElement.setattrb1("A");
.
.
elNodeAElement.setattrb4("D");

and below code can be used to populate Node B

IPrivate<View>.INodeANode elNode = INodeAElement.nodeNodeB();
IPrivate<View>.INodeAElement elondeBElement = elNode.createAndAddNodeAElement();
elondeBElement .setattrb1("A");
.
.
elondeBElement .setattrb4("D");

In the above snippet "INodeAElement" in the first line is the element created in the first code snippet. To create multiple NodeB child nodes repeat the second code snippet(asuming NodeB is Recursion Node).

You can also go through this document

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/47ce9b90-0201-0010-59b5-f70826824eee

Regards,

Vishwa

Answers (1)

Answers (1)

former_member219446
Participant
0 Kudos

solved