I am trying to pull data from child nodes but I cannot find the syntax that
works. I think I may be confusing elements and nodes? I want to get the
value of the items in the <Sched> child nodes. The relevant part of my code
are below as well as a part of the source xml.
=============== Code ==============================
Dim objDom As DOMDocument
Dim y As IXMLDOMElement
Dim x As IXMLDOMElement
Dim j as Integer
Set objDom = New DOMDocument
objDom.async = False
objDom.Load (inputfile)
Set objRootElement = objDom.documentElement
For Each x In objRootElement.childNodes
........
Select Case x.childNodes.Item(j).nodeName
......
Case "Sched"
For Each y In x.childNodes.Item(j) '<==== Error: "object
doesn't support this property or method"
xxx = y.childNodes.Item(1).Text
Next
Next
================ Sample XML ================
<?xml version="1.0" ?>
<root>
<base>
<SeqNbr>1</SeqNbr>
<PorF>P</PorF>
<Round>1</Round>
<Sched>
<ID>10</ID>
<Nickname>Group A</Nickname>
<Class>AAA</Class>
</Sched>
<Sched>
<ID>23</ID>
<Nickname>Group J</Nickname>
<Class>AAA</Class>
</Sched>
</base>
<base>
<SeqNbr>2</SeqNbr>
<PorF>F</PorF>
<Round>0</Round>
<Sched>
<ID>16</ID>
<Nickname>Group C</Nickname>
<Class>AA</Class>
</Sched>
<Sched>
<ID>27</ID>
<Nickname>Group D</Nickname>
<Class>AA</Class>
</Sched>
</base>
<base>
<SeqNbr>3</SeqNbr>
<PorF>P</PorF>
<Round>4</Round>
<Sched>
<ID>31</ID>
<Nickname>Group F</Nickname>
<Class>BB</Class>
</Sched>
<Sched>
<ID>23</ID>
<Nickname>Group G</Nickname>
<Class>BB</Class>
</Sched>
</base>