tags:

views:

19

answers:

1

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>
A: 

Try

/eveapi/result/rowset/row/@name 

and

/eveapi/result/rowset/row/@key
vtd-xml-author