Need a hand with XML, please [RSLVD]
Allright this is an easy one for all who have worked much with XML. I understand the structure, I think.. but I'm having issues with the syntax. I tried sniffing around this forum with no luck. The examples don't have what I'm looking for, are too complex, or I am generaly blind.
I have a file such as this one called Commands.xml
Code:
<FUNCTIONS>
<COMMAND>
<WHOIS>
<NAME Tag="Max">That is me</NAME>
</WHOIS>
</COMMAND>
All I want to do, is create a domDocument (done) and read the first element.. which is COMMAND. After that, I want to cycle through all the children of COMMAND incase there are more NAME elements.
My code:
Code:
'This is a type I have created
Private Type xmlCommandTree
docFile As New DOMDocument30
docParent As IXMLDOMElement
docCommand As IXMLDOMElement
docName As IXMLDOMElement
End Type
------------------------------------------
'Actuall function
Dim xCommand As xmlCommandTree
With xCommand
.docFile.Load "\commands.xml"
Set .docCommand = .docFile.firstChild
Set .docParent = .docCommand.firstChild
'Here I would put in a loop that cycles through all the children
'However, when I run this piece of code it sais:
'Object variable or With Block not set - Whats that mean?
End With
Can someone give me a hand before all my hair turns gray.
Thanks