XPath Trouble with getting attributes

Posted by Travis on Stack Overflow See other posts from Stack Overflow or by Travis
Published on 2010-05-14T04:50:15Z Indexed on 2010/05/14 4:54 UTC
Read the original article Hit count: 277

Filed under:
|

I'm having a bit of trouble with some XML in Java. The following is the result of an API call to EVE Online. How can I get the "name" and "characterID" for each row?

Frankly I just have no idea where to start with this one, so please don't ask for extra information. I just gotta know how to get those attributes.

<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="1">
  <currentTime>2007-12-12 11:48:50</currentTime>
  <result>
    <rowset name="characters" key="characterID" columns="name,characterID,corporationName,corporationID">
      <row name="Mary" characterID="150267069"
           corporationName="Starbase Anchoring Corp" corporationID="150279367" />
      <row name="Marcus" characterID="150302299"
           corporationName="Marcus Corp" corporationID="150333466" />
      <row name="Dieinafire" characterID="150340823"
           corporationName="Center for Advanced Studies" corporationID="1000169" />
    </rowset>
  </result>
  <cachedUntil>2007-12-12 12:48:50</cachedUntil>
</eveapi>

© Stack Overflow or respective owner

Related posts about java

Related posts about xpath