Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Attribitue value retrival >Thread Next - Re: Attribitue value retrival Re: Attribitue value retrivalTo: NULL Date: 2/1/2006 5:49:00 PM <lreames@g...> wrote in message
news:1138811117.434092.11760@g......
>I am new to XML, but not ASP.
>
> I have the following XML that I load via
>
> Dim xml
> Set xml = Server.CreateObject("Microsoft.XMLDOM")
> xml.async = False
> xml.loadXML xmldom.xml
>
> <deals><escanoffers><escanoffer offerid="3743" itemnumber="502022"
> upc="4300094509" dealamt="0.20" begindate="03/01/2006"
> enddate="03/30/2006" returnby="02/28/2006" selectionlength="14"
> maxretail="0.00" /></escanoffers></deals>
>
> I need to parse it, getting all the attributes out, using ASP.
>
> AHIA
> Larry...
>
Dim colAttList
Set colAttList = xml.selectNodes("/deals/escanoffers/escanoffer/@*")
You can then loop through the collection and retrieve the nodeName and
nodeValue for each attribute.
If there's only one <escanoffer> in the document.
If there maybe more then:
Dim colEscanoffer
Set colEscanoffer = xml.selectNodes("/deals/escanoffers/escanoffer")
Then loop through each element and select "@*" and proceed as above.
--
Joe Fawcett (MVP - XML)
https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
