You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an IE8-specific (and possibly more versions) issue. I can provide a PR. When loading a WMS Capabilities document via GeoExt and subsequently via the OpenLayers.Format.WMSCapabilities, the responseText parsing in OpenLayers.Format.XML may fail due to DTD/schema checking, strangely even if the XML is DTD-valid. First observed with GeoServer and a GXP example: http://lib.heron-mc.org/heron/latest/examples/catalognl where Layers are loaded via WMSCapabilities.
Apart from the issue that IE actually fetches the DTD over the network, creating overhead, I think that by default validation should be disabled as is for all other browsers. This can be done via the validateOnParse MS.XMLDOM property in the OpenLayers.Format.XML.read() function. I made a local override and can confirm that the following works.
.
.
var node = OpenLayers.Util.Try(
OpenLayers.Function.bind((
function() {
var xmldom;
/**
* Since we want to be able to call this method on the prototype
* itself, this.xmldom may not exist even if in IE.
*/
if(window.ActiveXObject && !this.xmldom) {
xmldom = new ActiveXObject("Microsoft.XMLDOM");
} else {
xmldom = this.xmldom;
}
xmldom.validateOnParse = false; // <======
xmldom.loadXML(text);
return xmldom;
}
), this),
function() {
return new DOMParser().parseFromString(text, 'text/xml');
},
.
.
A similar implementation was done in OL XMLHttpRequest.js as below.
function fGetDocument(oRequest) {
var oDocument = oRequest.responseXML,
sResponse = oRequest.responseText;
// Try parsing responseText
if (bIE && sResponse && oDocument && !oDocument.documentElement && oRequest.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)) {
oDocument = new window.ActiveXObject("Microsoft.XMLDOM");
oDocument.async = false;
oDocument.validateOnParse = false; // <========
oDocument.loadXML(sResponse);
}
The text was updated successfully, but these errors were encountered:
This is an IE8-specific (and possibly more versions) issue. I can provide a PR. When loading a WMS Capabilities document via GeoExt and subsequently via the OpenLayers.Format.WMSCapabilities, the responseText parsing in OpenLayers.Format.XML may fail due to DTD/schema checking, strangely even if the XML is DTD-valid. First observed with GeoServer and a GXP example: http://lib.heron-mc.org/heron/latest/examples/catalognl where Layers are loaded via WMSCapabilities.
Apart from the issue that IE actually fetches the DTD over the network, creating overhead, I think that by default validation should be disabled as is for all other browsers. This can be done via the validateOnParse MS.XMLDOM property in the OpenLayers.Format.XML.read() function. I made a local override and can confirm that the following works.
A similar implementation was done in OL XMLHttpRequest.js as below.
The text was updated successfully, but these errors were encountered: