I have an the below xml file . My job is tFileInputXML--->tExtractXMLField--->tlog
My tExtractXMLField is set as the below. It keeps returning the Only the first firstname for all the other rows instead of the expected results. How can I set it to return only
<root><status>success</status><data><users><firstname>Abby</firstname>
<book><name>ABC</name>
<state><complete>true</complete></state>
</book>
<book><name>ZZZ</name>
<state><complete>true</complete></state>
</book>
</users>
<users><firstname>Abdul</firstname>
<book><name>SeeSaw</name>
<state><complete>true</complete></state>
</book>
<book><name>WWW</name>
<state><complete>true</complete></state>
</book>
</users>
</data>
}
CodePudding user response:
your xpath syntax is not correct. You have based your loop element on "book". "firstname" and "book" being on the same level, if you want to access it you first have to move to the upper node.
use "../firstname"
instead.