Results 1 to 7 of 7

Thread: Need a hand with XML, please [RSLVD]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547

    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
    Last edited by invitro; May 30th, 2004 at 02:29 PM.
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width