Forum Discussion

John_Gimber's avatar
John_Gimber
New Contributor
15 years ago

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.
No RepliesBe the first to reply