John_R__Brewste
16 years agoOccasional Contributor
xpath and getNodeValues
Greeting,
How would I use getNodeValues if I was to get multiple nodes.
for example:
this is a test
Yet another test
If I use:
def holder = groovyUtils.getXmlHolder( "Book Author Search#Response" )
bartest = holder.getNodeVales ( "//bar" );
I can only update the FIRST bar! I have multiple "bar" that I need to update. How can I get to the others?
I read in the docs "If the specified XPath expression returns multiple values when getting a value, a String array is returned instead:" So, I get a string. I need the reference to the holder for each bar
or, am I thinking wrong?
JOhn
How would I use getNodeValues if I was to get multiple nodes.
for example:
If I use:
def holder = groovyUtils.getXmlHolder( "Book Author Search#Response" )
bartest = holder.getNodeVales ( "//bar" );
I can only update the FIRST bar! I have multiple "bar" that I need to update. How can I get to the others?
I read in the docs "If the specified XPath expression returns multiple values when getting a value, a String array is returned instead:" So, I get a string. I need the reference to the holder for each bar
or, am I thinking wrong?
JOhn