Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Can not load XML: An invalid character was found in text content. [Thread Next] Re: Can not load XML: An invalid character was found in text content.To: NULL Date: 1/5/2009 5:40:00 AM On 25 Dic 2008, 13:07, Martin Honnen <mahotr...@yahoo.de> wrote:
> alex.zeta wrote:
> > Now I get this essor: XML document must have a top level element.
>
> > This is the code I'm using.. (and as you all probably can see, I'm a
> > newbee about xml-parsing..)
>
> > Set xmlHttp =3D Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
> > xmlHttp.Open "GET", URLToRSS, false
> > xmlHttp.Send()
> > Set xmlDOM =3D xmlHttp.responseXML
>
> > If not xmlDOM.LoadXml(RSSXML) Then
> > ErrorMessage =3D "Can not load XML:" & vbCRLF & xmlDOM.parseError.reaso=
n
> > & vbCRLF & ErrorMessage
> > End If
>
> What is the LoadXml call good for? You don't have to parse any XML
> response yourself, it is already parsed.
> If you want to check for a parseError, fine, then do that as follows:
>
> Set xmlHttp =3D Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
> xmlHttp.Open "GET", URLToRSS, false
> xmlHttp.Send()
> Set xmlDOM =3D xmlHttp.responseXML
> If xmlDOM.parseError.errorCode <> 0 Then
> =A0 =A0'output parseError.reason
> Else
> =A0 =A0'use xmlDOM here
> End If
>
> --
>
> =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML
> =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/
Thank you guys.
It worked!
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
