Hi,
I am working on an XML file using the XPath node where I have a test structure as follows. I need to find the immediate parent node of any given employee using //Employee[@id=<nodeid>]/parent::*/@id which works as I verified on online XPath testers.
To iterate over the entire range of Employee IDs, I used the Ungroup node and the Table Row to Variable Loop start node, and the iteration works all well, with one problem: I need to pass the variable currentNodeId on to the XPath above so I can get a return of the immediate parent. I tried using the variable port and saw that the currentNodeId is now part of the flow variables in the XPath (under Flow Variables), and typed: //Employee[@id=currentNodeId]/parent::*/@id but this does not seem to work. I tried something like $currentNodeId$ but I got a syntax error.
How can I get this problem resolved?
Thanks!
<?xml version="1.0" encoding="UTF-8"?>
<Employees>
<Employee id="1">
<name>John</name>
<Employee id="2">
<name>Lisa</name>
</Employee>
</Employee>
<Employee id="3">
<name>Tom</name>
</Employee>
<Employee id="4">
<name>Dave</name>
</Employee>
</Employees>