Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Extracting XML with ASP can't find answer.

Reply
Thread Tools

Extracting XML with ASP can't find answer.

 
 
Shawn
Guest
Posts: n/a
 
      10-15-2004
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.
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-15-2004
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.


 
Reply With Quote
 
 
 
 
Chris Barber
Guest
Posts: n/a
 
      10-16-2004
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]" <(E-Mail Removed)> wrote in message
news:%23%(E-Mail Removed)...
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 3 02-14-2011 05:28 AM
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM
Extracting XML fragments Roger Varley Java 3 09-04-2003 06:14 PM



Advertisments