Extracting XML with ASP can't find answer.

S

Shawn

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.
 
B

Bob Barrows [MVP]

Shawn said:
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
 
C

Chris Barber

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.

Shawn said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top