• XML (XP)

    Author
    Topic
    #455904

    In the following example I can get the text of child nodes with –
    varData = xmlDoc1.Childnodes(i).Text
    However, I can’t figure out how to get the value set in a parent node – for example – the Meeting ID in – or the Event ID in the text property seems to return the text from all of the nodes children



    ASCOT
    R
    9GOOD
    3

    I tried .attributes(“ID) and a variety of alternatives but I just cant find the right syntax

    Viewing 0 reply threads
    Author
    Replies
    • #1137420

      XML generation in Access 2002 can be a challenge – I’ve only done a little with it, and it seems the most effective way to do it is to export individual tables as separate documents. If I try to export it in a single document it generates far more data than I want. I believe that 2003 and 2007 do a much better job of this, but haven’t worked on it with either of those versions.

      • #1137468

        Thanks Wendall, I finally worked it out (ie I found an example in another procdure I wrote some time ago) –

        strEventID = xmlDoc1.childnodes(intCount1).getAttribute(“ID”)

        I was thinking that I should be looking for a property in the Attributes collection but instead it seems that I need to use a method ‘GetAttribute’ though I still think this is counter intuitive.

        I get this XML from a website by passing it a path and method, then parse the XML returned into my tables.

        “The answer to every software question is logical – given hindsight.”

        • #1137492

          Hi Kent, can you please post the procedure(s) containing the code that allows you to “to get the value set in a parent node” and to “get this XML from a website by passing it a path and method, then parse the XML returned into my tables.”
          ?

          • #1137493

            Here is a zip with a screen shot of the XML Sample and an MDB with the code.
            Obviously you can’t actually use the code, ’cause you won’t have a session ID but you should be able to get a good idea of how it all works.

    Viewing 0 reply threads
    Reply To: XML (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: