Project

Profile

Help

Bug #4830

HTML response from ixsl:schedule-action is parsed as XML, causing failure

Added by Michael Kay 8 days ago. Updated 8 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
IXSL extensions
Sprint/Milestone:
-
Start date:
2020-11-18
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2.0
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

(Reported by Martynas Jusevičius 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.

History

#1 Updated by Michael Kay 8 days 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.

Please register to edit this issue

Also available in: Atom PDF Tracking page