[thelist] CF man needs ASP XML help
Chris Hayes
chris at londonweb.net
Fri Apr 16 12:38:25 CDT 2004
Thanks Scott, it's always good to know you're barking up the right tree.
I have so many ways to play with it I can't be sure which are going to part
of the magic bullet. My best shot is below which gives me this error:
Microsoft VBScript runtime error '800a01a8'
Object required: 'xmlDOMDOC.documentelement.selectSingleNode(...)'
I'm assuming having MSXML 4 on ther server is enough?
Do I need to specify docelement in the XPath, as this is the
documentElement? I have played with it to no avail.
The sError line "works" if I remove innerText, but then response.write
sError gives an error that it hasn't been set.
I'll continue to play but if you can spot the obvious, please shout.
Cheers
==========================================
Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
xml.Open "GET", psFeedPage, False, UserName, Password
xml.Send
sOutput = xml.responseXML.xml
Set xmlDOMDOC = Server.CreateObject("MSXML2.DOMDocument.4.0")
xmlDOMDOC.loadXML sOutput
'I tried with and without specifying XPath
' xmlDOMDOC.setProperty "SelectionLanguage", "XPath"
sError=xmlDOMDOC.documentelement.selectSingleNode("docelement/feedoutput/res
ult/error").innerText
Response.Write sError
==========================================
----- Original Message -----
From: "Scott Dexter" <dexilalolai at yahoo.com>
To: <thelist at lists.evolt.org>
Sent: Friday, April 16, 2004 5:39 PM
Subject: Re: [thelist] CF man needs ASP XML help
> > <?xml version="1.0"?>
> > <docelement>
> > <feedoutput>
> > <result>
> > <error><![CDATA[0]]></error>
> > <description><![CDATA[Some data.]]></description>
> > </result>
> > </feedoutput>
> > </docelement>
> >
> >
> > Should I be using DOMDocument? When I do I can't figure out how to
> > traverse
> > and pick out values.
>
> Yup, DOMDocument is your friend:
>
> Set xmlDOMDOC = Server.CreateObject("MSXML2.DOMDocument.4.0")
> xmlDOMDOC.loadXML xmlResponse
>
> sError =
>
xmlDOMDOC.documentelement.selectSingleNode("docelement/feedoutput/result/err
or").InnerText
>
>
> That's from memory, you may have to play with it a bit....
>
> Hope it helps some,
> Scott
> --
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
More information about the thelist
mailing list