HTML response from ixsl:schedule-action is parsed as XML, causing failure
(Reported by Martynas Jusevičius email@example.com on saxon-help mailing list on 2 Nov 2020).
Saxon receives an HTTP response with content type text/html and attempts to parse it as XML, causing a failure FODC0002.
In this particular case it's an error response with HTTP status 400, but I think the same failure could occur on a success response.
At BrowserPlatfform.js line 393 we do
case "text/html": // HTML types response.body = http.responseXML || parse(http.responseText); break;
where parse() is invoking the XML parser. This looks incorrect.
Updated by Michael Kay about 3 years ago
According to https://stackoverflow.com/questions/10585029/parse-an-html-string-with-js we should be doing
new DOMParser().parseFromString(html, "text/html");
or perhaps we should be calling our existing parseXmlFromString() method with a second parameter giving the media type, which would have the same effect.
Updated by Debbie Lockett almost 3 years ago
- Status changed from Resolved to In Progress
Reopening as I'm seeing some new failures for fn-transform tests in the browser (e.g. fn-transform-4), which look to be caused by the changes. The Platform.parseXmlFromString method already has a second argument (lineNumbering) defined for the NodePlatform, so we're now sometimes getting a conflict.
Please register to edit this issue