John_Gimber
15 years agoNew Contributor
Determining child node names?
Hi,
I have a response which contains something like this:
<path1>
<name1>
<data>...
<data>...
<data>...
<name2>
<data>...
<data>...
<data>...
<name3>
<data>...
<data>...
<data>...
</path1>
where name1..x could be anything - i.e. not fixed values.
Although I can count the number of items in path1...
def requestProcessorsFound = responseHolder["count(//path1/*)"].toInteger()
... I can't see how to iterate through and retrieve and use the names of the keys within path1.
Can anybody suggest a chunk of code or function call that would return the "name1", "name2", "name3" values?
Many thanks,
John.
I have a response which contains something like this:
<path1>
<name1>
<data>...
<data>...
<data>...
<name2>
<data>...
<data>...
<data>...
<name3>
<data>...
<data>...
<data>...
</path1>
where name1..x could be anything - i.e. not fixed values.
Although I can count the number of items in path1...
def requestProcessorsFound = responseHolder["count(//path1/*)"].toInteger()
... I can't see how to iterate through and retrieve and use the names of the keys within path1.
Can anybody suggest a chunk of code or function call that would return the "name1", "name2", "name3" values?
Many thanks,
John.