Ticket #1103 (new bug)

Opened 6 years ago

Last modified 4 years ago

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

Reported by: elemoine Owned by: tschaub
Priority: major Milestone: Future
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 Download (0.9 KB) - added by elemoine 6 years ago.
file.gml Download (22.6 KB) - added by elemoine 6 years ago.
file-simplified.gml Download (2.9 KB) - added by elemoine 6 years ago.

Change History

Changed 6 years ago by elemoine

Changed 6 years ago by elemoine

  Changed 6 years ago by elemoine

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

follow-up: ↓ 3   Changed 6 years ago 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)

Changed 6 years ago by elemoine

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 6 years ago 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   Changed 6 years ago 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

  Changed 4 years ago by crschmidt

  • milestone set to Future
Note: See TracTickets for help on using tickets.