cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between node and element in context.

Former Member
0 Kudos

Hi

I have below context elements.

Root Context

-


Node Test

-


Value T1

Now there are 2 ways I can access to value attribute t1.

1.

wdContext.currentTestElement().getT1()

2.

wdContext.nodeTest().currentTestElement().getT1();

What is difference.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

There is no difference, wdContext.currentXXXElement is just a shortcut and easier to use for the developer. What really happens in the background is "get the node, then the current element (the element with the active index)

Former Member
0 Kudos

Adding to that, I believe the 'longer' version provides more readability for other developers. So, better to use the longer version, IMO.

Regards,

Jan

Former Member
0 Kudos

Thanks for comments,

But after working on it now as I find is :

If your elements are subject to exist n times at runtime, in that case currentcontextelement automatically gives you access to active context node. Wereas, nodexxx() gives access to the node element as a group, after which you can access to any elemt inside that node group. e.g.

wdContext.nodeTest().getElementAt(n)

Thanks