Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Attribitue value retrival [Thread Next] Re: Attribitue value retrivalTo: NULL Date: 2/1/2006 6:57:00 PM
lreames@g... wrote:
> 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")
Make sure you have at least MSXML 3 and then use a version specific
program id e.g. for MSXML 3
Set xml = Server.CreateObject("Msxml2.DOMDocument.3.0")
that way you can be sure what kind of XPath support you are going to have.
> xml.async = False
> xml.loadXML xmldom.xml
I don't get why you want to do that, you have on DOM document but need
to load it into another? It might make sense if you need a copy to
manipulate but you can directly do
xml.load xmldom
in that case, no need to serialize to string and then load from a string.
> I need to parse it, getting all the attributes out, using ASP.
If you want all attributes then you can use XPath and selectNodes e.g.
xml.setProperty "SelectionLanguage", "XPath"
Set attributeNodes = xml.selectNodes(_
"//*/@*")
For Each attribute in attributeNodes
' access attribute.nodeValue or attribute.value
Next
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
