'talend tExtractXMLField returns same firstname instead of moving to next firstname tag
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>
}
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Corentin |


