cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the current node element by its value?

Former Member
0 Kudos

e.g,:

wdContext.current<b>Deal</b>Element().setAttributeValue("<i>deal_id</i>","<i>aaaaaaa</i>");

above code can get the result i wanna.

but now i wanna in terms of its node'name to set attribute vaue of itself. in other words,i have no idea about how to get the current node element by its name"<b>Deal</b>".

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member286976
Active Participant
0 Kudos

Hi Wing,

The answer is there in your question itself.

wdContext.currentDealElement()

will give you the current node element by its name"Deal" or you could use

wdContext.nodeDeal().getCurrentElement()

or you could use

wdContext.nodeDeal().getElementAt(wdContext.nodeDeal().getLeadSelection())

Regards,

Sudeep

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

I am little unclear about the question, but i guess this is what you are alooking for

IWDNode nodeObj = wdContext.getChildNode("Deal",0);

in above stmt , it will get you the the node Deal from the root contexts 0th element.

then you can retrieve its element as,

IWDNodeElement nodeEle = nodeObj.getElementAt(<index>); //will get you the element at location index

let me know if you are in doubt

hope it helps

regards