• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get attribute names of XML tags in groovy?  RSS feed

 
Nazeer Ahammad
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I need one help. Please see the below xml file content

<students>
<student name="###" id="###" college="###"></student>
<students>

In the above xml, I need to display attribute student tag names(name,id and college).
How can i do this in Groovy.
Please help me.

Thanks,
Nazeer.
 
Mohamed Sanaulla
Bartender
Posts: 3169
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember writing a blog post on parsing XML using XmlSlurper in Groovy where I have mentioned how to access the attribute name. The same can be found here.

PS: Sorry for plugging in my blog, but the post serves your query.
 
Pankaja Shinde
Ranch Hand
Posts: 87
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!