Project

Profile

Help

Edge gives SCRIPT5022: XError: Misplaced or malformed XML SaxonJS.min.js (1,11772) with code that works with other browsers

Added by Martin Honnen almost 7 years ago

When loading https://martin-honnen.github.io/xslt/2017/ui-test2.html in Edge on Windows 10 it does not seem to successfully execute the called XSLT and instead shows two errors in its console:

SCRIPT5022: XError: Misplaced or malformed XML
SaxonJS.min.js (1,11772)

The code works fine with IE, Firefox and Chrome.

XSLT is https://martin-honnen.github.io/xslt/2017/ui-test2.xsl respectively https://martin-honnen.github.io/xslt/2017/ui-test2.sef.


Replies (4)

Please register to reply

RE: Edge gives SCRIPT5022: XError: Misplaced or malformed XML SaxonJS.min.js (1,11772) with code that works with other browsers - Added by Martin Honnen almost 7 years ago

Edge (Microsoft Edge 40.15063.0.0) seems to give true on the


if (/^.+<\?xml/i.test(str)) {
                    throw new Error();
                }     

check in @parseXmlFromString@.

Test case is https://jsfiddle.net/1rgknpwq/.

RE: Edge gives SCRIPT5022: XError: Misplaced or malformed XML SaxonJS.min.js (1,11772) with code that works with other browsers - Added by Debbie Lockett over 6 years ago

The Saxon-JS 1.0.2 release includes a patch for this Edge problem (while we are still awaiting a new major release of Edge with the bug fix).

The use of Edge is detected internally by Saxon-JS 1.0.2, and then avoids the problematic regex check used in reading XML resources. The consequence is that some invalid XML source (specifically with content before the XML header) may be permitted when using Edge.

RE: Edge gives SCRIPT5022: XError: Misplaced or malformed XML SaxonJS.min.js (1,11772) with code that works with other browsers - Added by Martin Honnen over 6 years ago

https://jsfiddle.net/1rgknpwq/ shows false with

Microsoft Edge 41.16299.15.0
Microsoft EdgeHTML 16.16299

included as part of the Microsoft Windows 10 Creators Update Fall 2017 (also known as Windows 10 Version 1709) so it seems that the fix from https://github.com/Microsoft/ChakraCore/issues/3366 finally made it into an Edge release.

    (1-4/4)

    Please register to reply