[Xsltforms-support] XHR response error for non-XML content types
Brought to you by:
alain-couthures
From: Tim T. <tim...@gm...> - 2015-07-10 14:08:40
|
Alain, I'm testing XSLTForms on an Apache XAMPP server (though not yet with SaxonHE9-4-0-7), and I had (another) question about browser errors. Here's a Gist that shows a basic submission from XSLTForms to DBpedia's SPARQL endpoint, using @replace="text" on the <xf:submission> element: https://gist.github.com/Timathom/176a1e6865215b00d544 This works beautifully, but in Firefox and IE 11, I am getting browser errors on the XHR response. Here is the HTTP response header in Firefox: HTTP/1.1 200 OK Date: Fri, 10 Jul 2015 13:26:30 GMT Content-Type: application/ld+json Content-Length: 7127 Connection: keep-alive Server: Virtuoso/07.20.3214 (Linux) i686-generic-linux-glibc212-64 VDB Access-Control-Allow-Origin: http://localhost access-control-allow-credentials: true access-control-expose-headers: Content-Type Access-Control-Allow-Headers: Accept, Authorization, Slug, Link, Origin, Content-type Expires: Fri, 17 Jul 2015 13:26:30 GMT Cache-Control: max-age=604800 Accept-Ranges: bytes Even though the server returns a Content-Type of "application/ld+json," the browser still tries to parse it as XML. Firefox throws this error (via Firebug): XML Parsing Error: not well-formed Location: moz-nullprincipal:{a25b11dd-9e4b-5f40-bb8b-b9415ed8d56e} Line Number 1, Column 1: { "@graph": [ ^ IE 11 throws this error: XML5619: Incorrect document syntax. Line: 1, Column 1 Chrome does not throw a (visible) error. I guess that these errors are probably harmless, but is there any way to avoid them, and to prevent the browser from trying to parse the response as XML when the XForms submission has a @replace attribute value of "text" and the Content-Type of the response is a non-XML format? Thanks again! Tim -- Tim A. Thompson Metadata Librarian (Spanish/Portuguese Specialty) Princeton University Library |