Discussions

XML & Web services: How to get the attribute value of an XML file??

  1. How to get the attribute value of an XML file??

    For example, how to get name and age attributes?

    <student name="Joe" age="20" />
  2. Use JAXP and DOM:

    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/
  3. Using Xpath to can get the elemenet and then get the attributes
    I guess using '@' followed by attribute name.