Meaningless Drivel is fun!*
The moose likes Groovy and the fly likes How to convert xml tag attribute values  to map object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "How to convert xml tag attribute values  to map object?" Watch "How to convert xml tag attribute values  to map object?" New topic
Author

How to convert xml tag attribute values to map object?

Nazeer Ahammad
Ranch Hand

Joined: Feb 26, 2012
Posts: 43
Hi All,

Is it possible to convert xml tag attributes to map?

For an instance :
<students>
<student name="sname" id="sid" college="collegename">
</students>

by parsing this i have to get map object like [name:"sname", id:"sid",college:collegename]



Regards,
Nazeer
Pankaja Shinde
Ranch Hand

Joined: Sep 15, 2006
Posts: 87
http://groovy.codehaus.org/Reading+XML+using+Groovy's+XmlParser
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to convert xml tag attribute values to map object?
 
Similar Threads
I'm not able to insert record in Derby using Hibernate
struts+spring+hibernate
xml to java objects
Could not read mappings from resource(Mapping issue)
How to get attribute names of XML tags in groovy?