[OpenLayers-Users] loading XML problem
Bart van den Eijnden (OSGIS)
bartvde at osgis.nl
Tue Sep 25 03:51:37 EDT 2007
It seems responseText cannot deal with ISO-8859-1, so the only way to do
that is to use responseXML.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/b035fdea-8665-4d7b-80f0-3624d269e7b6.asp
Best regards,
Bart
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
--------- Oorspronkelijk bericht --------
Van: Andrew Larcombe <andrew at andrewlarcombe.co.uk>
Naar:
Cc: users at openlayers.org
Onderwerp: Re: [OpenLayers-Users] loading XML problem
Datum: 24/09/07 19:44
>
> On 24 Sep 2007, at 15:35, Bart van den Eijnden (OSGIS) wrote:
>
> > This works fine (result = true):
> >
> > var url = 'http://www.osgis.nl/download/weggeg.xml';
> > var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
> > xmlDoc.async=false;
> > result = xmlDoc.load(url);
> >
> > Whereas this does not work (result = false):
> >
> > var url = 'http://www.osgis.nl/download/weggeg.xml';
> > OpenLayers.loadURL(url, null, this, parseGetCapabilities);
> >
> > function parseGetCapabilities(ajaxRequest)
> > {
> > var text = ajaxRequest.responseText;
> > var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
> > xmlDoc.async=false;
> > result = xmlDoc.loadXML(text);
> > }
> >
> > result is false in this case with the parsing error pointing to the
> > special
> > character.
>
> The difference looks to be in that in the first case the ActiveX
> control loads the contents of the xml file, whilst in the second it
> is passed the contents of the xml file as held in a variable. If the
> process of reading that file's contents into the variable munge up
> the xml somehow then that might be where your problem is.
>
> Can you attempt to further isolate the problem outside of OL by
> creating an AJAX request to your url, storing it in a variable, then
> loading it into the activex control using loadXML.
>
> Cheers,
>
> Andrew
>
> ---
> Andrew Larcombe
> Freelance Geospatial, Database & Web Programming
>
> web: http://www.andrewlarcombe.co.uk
> email: andrew at andrewlarcombe.co.uk
> icq: 306690163
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
More information about the Users
mailing list