- Joined
- Jun 23, 2008
- Messages
- 3
- Reaction score
- 0
Hello,
I'm trying to parse an XML document.
I found a solution using sax that
works pretty well:
Now I need to read the fields in the XML files that are shaped like this:
I can't seem to find out how this is done.
Can somebody please point me in the right direction?
I'm not sure of the right search terms to google for this
Thanks in advance!
I'm trying to parse an XML document.
I found a solution using sax that
works pretty well:
if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
Element firstPersonElement = (Element)firstPersonNode;
NodeList firstNameList = firstPersonElement.getElementsByTagName("FirstName");
Element firstNameElement = (Element)firstNameList.item(0);
NodeList textFNList = firstNameElement.getChildNodes();
patient.firstName = ((Node)textFNList.item(0)).getNodeValue().trim();
.......
Now I need to read the fields in the XML files that are shaped like this:
<Transaction>
<Item>
<ID Country="US" IDSystem="IdSys">11321</ID>
<ItemType>
<ID Country="US" IDSystem="Sys">70</ID>
<Description Language="EN">Weight</Description>
</ItemType>
<ItemContent DataType="NM" Units="kg">75</ItemContent>
</Item>
<Item>
<ID Country="US" IDSystem="IdSys">11321</ID>
<ItemType>
<ID Country="US" IDSystem="Sys">80</ID>
<Description Language="EN">Height</Description>
</ItemType>
<ItemContent DataType="NM" Units="cm">180</ItemContent>
</Item>
</Transaction>
I can't seem to find out how this is done.
Can somebody please point me in the right direction?
I'm not sure of the right search terms to google for this
Thanks in advance!