Extracting XML with ASP can't find answer.

Discussion in 'ASP General' started by Shawn, Oct 15, 2004.

  1. Shawn

    Shawn Guest

    I have an XML file that contains nodes and I'm having no problem
    extracting the information using ASP. However I can't seem to get the
    ID number from the deliverrequest node from the example below.
    Driving me crazy.. any help would be appreciated. Thanks

    <!DOCTYPE xiamSMS SYSTEM "Message.dtd">
    <xiam>
    <deliverRequest id="10234690"> ''' Need to retrieve this number using
    ASP
    <to>test</to>
    <from>number</from>
    <content type="text">Test 2</content>
    </deliverRequest>
    </xiam>

    Thanks.
     
    Shawn, Oct 15, 2004
    #1
    1. Advertising

  2. Shawn wrote:
    > I have an XML file that contains nodes and I'm having no problem
    > extracting the information using ASP. However I can't seem to get the
    > ID number from the deliverrequest node from the example below.
    > Driving me crazy.. any help would be appreciated. Thanks
    >
    > <!DOCTYPE xiamSMS SYSTEM "Message.dtd">
    > <xiam>
    > <deliverRequest id="10234690"> ''' Need to retrieve this number using
    > ASP
    > <to>test</to>
    > <from>number</from>
    > <content type="text">Test 2</content>
    > </deliverRequest>
    > </xiam>
    >
    > Thanks.

    dim id
    id=xmldoc.selectSingleNode("/xiam/deliverRequest").getAttribute("id")

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 15, 2004
    #2
    1. Advertising

  3. Shawn

    Chris Barber Guest

    another method ...

    Dim id
    id = xmldoc.selectSingleNode("/xiam/deliverRequest/@id").nodeTypedValue

    Jut a personal preference to have the attribute as part of the Xpath (I think this works without
    setting the SelectionLanguage property for the xmldoc?).

    Chris.

    "Bob Barrows [MVP]" <> wrote in message
    news:%23%...
    Shawn wrote:
    > I have an XML file that contains nodes and I'm having no problem
    > extracting the information using ASP. However I can't seem to get the
    > ID number from the deliverrequest node from the example below.
    > Driving me crazy.. any help would be appreciated. Thanks
    >
    > <!DOCTYPE xiamSMS SYSTEM "Message.dtd">
    > <xiam>
    > <deliverRequest id="10234690"> ''' Need to retrieve this number using
    > ASP
    > <to>test</to>
    > <from>number</from>
    > <content type="text">Test 2</content>
    > </deliverRequest>
    > </xiam>
    >
    > Thanks.

    dim id
    id=xmldoc.selectSingleNode("/xiam/deliverRequest").getAttribute("id")

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.




    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.777 / Virus Database: 524 - Release Date: 14/10/2004
     
    Chris Barber, Oct 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PJ
    Replies:
    2
    Views:
    565
    KathyB
    Jul 19, 2003
  2. suzy
    Replies:
    3
    Views:
    339
  3. Shanknbake
    Replies:
    17
    Views:
    649
    Oliver Wong
    Nov 14, 2005
  4. Replies:
    1
    Views:
    510
    Victor Bazarov
    Aug 17, 2005
  5. hcchen (gmail)
    Replies:
    0
    Views:
    332
    hcchen (gmail)
    Jan 18, 2009
Loading...

Share This Page