Skip to Content
0
Former Member
Feb 17, 2011 at 07:21 AM

how to insert data in a child node

77 Views

Hi all,

I have a parent node P and a child node C now for a particular attribute of parent node I check the value and populate C node attribute accordingly ie say P has an attribute A so P.A = 1 now if it is equal to 1 then in child no C Ineed to populate its 2 attribute ie value and code as C.value=xyz and C.value= 1. This population I am doing after executing the rfc taking values from its output node and checking condition and populating but I am getting null pointer exception.

The code I am using is follows:

if(rfcouputnode.attribute.equalignorecase("1")

{

ICElement ele = wdcontext.nodeC.createCElement;

ele.setCode("1");

ele.setValue("xyz");

wdContext. nodeP.nodeC.addelement(ele)

}

The parent node cardinality is 0..n

selection 0..n

singleton true

Child node cardinality is 0..n

selection 0..1

singleton false

Kindly let me know wut could i possibly be doin wrong.

Thank you

Regards,

Preet