how to get attribute key/values with XMLSlurper?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to get attribute key/values with XMLSlurper?

Bob S

I'm using XMLSlurper to read a short xml file.  For a given node I can get its attributes using 'attributes()', and I can get the size() of that to know how many there are.  But I can't figure out how to get each attribute's key and value.

If I know an attribute is, say "Name"="Jim", I can say Node.@Name to get "Jim" back.  But what if I want to iterate over all the attributes and store both the key and the value in a list?

Thanks for any suggestions!

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit