OpenLayers OpenLayers

Ticket #1103 (new bug)

Opened 9 months ago

Last modified 8 months ago

OpenLayers.parseXMLString() fails to create DOM element on IE

Reported by: elemoine Assigned to: tschaub
Priority: major Milestone:
Component: Format.XML Version: 2.5
Keywords: Cc:
State:

Description

My WFS layer doesn't work on IE - features don't get displayed. I investigated the problem a bit and Format.XML.read() fails to deserialize the XML string. I then played with OpenLayers.parseXMLString() and it also fails to deserialize the XML string.

You can use the attached bug.html and file.gml files to reproduce the problem. On IE, the two OpenLayers.Console.log() statements don't output anything on the firebug console.

Attachments

bug.html (0.9 kB) - added by elemoine on 10/23/07 07:40:56.
file.gml (22.6 kB) - added by elemoine on 10/23/07 07:41:28.
file-simplified.gml (2.9 kB) - added by elemoine on 10/23/07 08:51:21.

Change History

10/23/07 07:40:56 changed by elemoine

  • attachment bug.html added.

10/23/07 07:41:28 changed by elemoine

  • attachment file.gml added.

10/23/07 07:43:13 changed by elemoine

  • priority changed from minor to major.
  • type changed from feature to bug.

(follow-up: ↓ 3 ) 10/23/07 08:51:05 changed by elemoine

crschmidt suggested that I try removing the accentuated letters in my gml file in case IE ignores the charset. So I did, and the problem is still there.

(in case it's useful I'll attch a simplified gml file with no accentuated letters and a single feature)

10/23/07 08:51:21 changed by elemoine

  • attachment file-simplified.gml added.

(in reply to: ↑ 2 ; follow-up: ↓ 4 ) 10/24/07 00:38:53 changed by elemoine

Replying to elemoine:

crschmidt suggested that I try removing the accentuated letters in my gml file in case IE ignores the charset. So I did, and the problem is still there. (in case it's useful I'll attch a simplified gml file with no accentuated letters and a single feature)


Actually, removing the accentuated letters do change things.

OpenLayers.parseXMLString(request.responseText), as used in bug.html, still doesn't work but I've done some testing and OpenLayers.Format.GML.read() seems to work when there's only ascii characters in the GML file.

What might happen in the non-ascii characters case (on top of my head):

  • IE tries to read the file and return a DOM object in responseXML, but it fails to do so because of the non-ascii characters. So it just returns a string in responseText.
  • OpenLayers.Layer.GML receives the file in responseText and uses OpenLayers.Format.XML to deserialize the responseText string in a DOM object. It fails for the exact same reason.

These notes may be fuzzy, they're here for me to keep track with things.

(in reply to: ↑ 3 ) 10/27/07 07:03:19 changed by elemoine

Replying to elemoine:

Replying to elemoine:

crschmidt suggested that I try removing the accentuated letters in my gml file in case IE ignores the charset. So I did, and the problem is still there. (in case it's useful I'll attch a simplified gml file with no accentuated letters and a single feature)

---- Actually, removing the accentuated letters do change things. OpenLayers.parseXMLString(request.responseText), as used in bug.html, still doesn't work but I've done some testing and OpenLayers.Format.GML.read() seems to work when there's only ascii characters in the GML file. What might happen in the non-ascii characters case (on top of my head): - IE tries to read the file and return a DOM object in responseXML, but it fails to do so because of the non-ascii characters. So it just returns a string in responseText. - OpenLayers.Layer.GML receives the file in responseText and uses OpenLayers.Format.XML to deserialize the responseText string in a DOM object. It fails for the exact same reason. These notes may be fuzzy, they're here for me to keep track with things.


pgiraud and I investigated this a bit further. It seems that there are character encoding restrictions with MSXML DOM. This isn't crystal clear to me, so I still don't know whether OL could work around these restrictions, for by example by using load() instead of loadXML().

http://msdn2.microsoft.com/en-us/library/aa468560.aspx#xmlencod_topic3