Chance1234
IS-IT--Management
very very very new to all this,
Ive got the following code, all i want to do is retrieve the name of the node?tag? and its value, my xmldata is below and ideally what i want to return is the following
Type
Telephone Calls
case
343434K
date
1/4/03
description
Claim for calls
amount
34.54
etc etc ect
Sub subGetDataFromXMLFile()
Dim myXMLDoc As New DOMDocument
Dim ClaimList As IXMLDOMNodeList
Dim MyItem As IXMLDOMElement
myXMLDoc.Load ("h:\aXML.xml"
Set ClaimList = myXMLDoc.documentElement.childNodes
For Each MyItem In ClaimList
Debug.Print MyItem.Text
Next
Set myXMLDoc = Nothing
Set ClaimList = Nothing
End Sub
<?xml version="1.0" ?>
- <ClaimSheet>
- <item>
<Type>Telephone Calls</Type>
<case>343434K</case>
<date>1/4/03</date>
<description>Claim for calls.</description>
<amount>34.54</amount>
</item>
- <item>
<Type>Stationary</Type>
<case>342323N</case>
<date>2/4/03</date>
<description>Claim for stationary.</description>
<amount>33.00</amount>
</item>
- <item>
<Type>Travel</Type>
<case>12323X</case>
<date>3/4/03</date>
<description>travel to case.</description>
<amount>143.00</amount>
</item>
</ClaimSheet>
Ive got the following code, all i want to do is retrieve the name of the node?tag? and its value, my xmldata is below and ideally what i want to return is the following
Type
Telephone Calls
case
343434K
date
1/4/03
description
Claim for calls
amount
34.54
etc etc ect
Sub subGetDataFromXMLFile()
Dim myXMLDoc As New DOMDocument
Dim ClaimList As IXMLDOMNodeList
Dim MyItem As IXMLDOMElement
myXMLDoc.Load ("h:\aXML.xml"
Set ClaimList = myXMLDoc.documentElement.childNodes
For Each MyItem In ClaimList
Debug.Print MyItem.Text
Next
Set myXMLDoc = Nothing
Set ClaimList = Nothing
End Sub
<?xml version="1.0" ?>
- <ClaimSheet>
- <item>
<Type>Telephone Calls</Type>
<case>343434K</case>
<date>1/4/03</date>
<description>Claim for calls.</description>
<amount>34.54</amount>
</item>
- <item>
<Type>Stationary</Type>
<case>342323N</case>
<date>2/4/03</date>
<description>Claim for stationary.</description>
<amount>33.00</amount>
</item>
- <item>
<Type>Travel</Type>
<case>12323X</case>
<date>3/4/03</date>
<description>travel to case.</description>
<amount>143.00</amount>
</item>
</ClaimSheet>