Skip to content

XML Syntax error for large XML files in Chrome #145

@eherr

Description

@eherr

Chrome raises XML Syntax error exceptions when processing large XML files. The error can be caused by referencing to an asset file larger than 60 mb generated by ATLAS 1.0.

<group id="middle_console" >
        <model src="assets/middle_console3.xml#middle_console3"></model>
</group>

In xml3d version 4.8 and 5.0 the reference to the asset leads to the following error messages:

xml3d-5.0: resourcemanager.js:291 Uncaught TypeError: Cannot set property '_documentURL' of null
xml3d-4.8: xml3d-4.8.js:1403 Invalid external XML document 'http://localhost:8889/assets/middle_console3.xml': XML 

The same problem occurs for GET requests for large XML files. This was tested with the ATLAS 1.0 REST interface and the Compass client 2.0.1 (that uses xml3d version 'DEVELOPMENT SNAPSHOT (19.09.2014 14:57:58 MESZ)';.

xml3d.js.xhtml:1497 Invalid external XML document ... url ... : XML Syntax error
ns.debug.doLog  @   xml3d.js.xhtml:1497
ns.debug.logError   @   xml3d.js.xhtml:1520
setDocumentData @   xml3d.js.xhtml:9999
processResponse @   xml3d.js.xhtml:9972
xmlHttp.onreadystatechange  @   xml3d.js.xhtml:9952

The problem was reproduced in a different client that loads assets from ATLAS 1.0 using the following request.

$.ajax({
type: "GET",
dataType: 'xml',
url: uri,
headers: { "Accept":"model/vnd.xml3d.model+xml, */*; q=0.5"    },
success: function(response) {
  ....
}});

The problem could be circumvented in this client by making the request with the response type set to 'text'. The response can then be converted into an XML DOM Object using the DOMParser object.

$.ajax({
type: "GET",
dataType: 'text',
url: uri,
headers: { "Accept":"model/vnd.xml3d.model+xml, */*; q=0.5"    },
success: function(response) {
  parser=new DOMParser();
  xmlDoc=parser.parseFromString(response ,"text/xml");
  ....
}});

Performing the GET requests with an XMLHttpRequest object instead of jquery has corresponding results for the response types 'text' and 'document'.

The problem was found only in Chrome (Version 45.0.2454.85 m, 32 and 64-bit). Firefox (Version 40.0.3) can process the XML files produced by ATLAS 1.0 without a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions