Project

Profile

Help

Bug #4176

closed

parse-xml() in Saxon-JS loses html namespace

Added by David Cramer almost 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Internals
Sprint/Milestone:
-
Start date:
2019-03-22
Due date:
% Done:

0%

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

Description

To reproduce:

  1. Unzip the attached zip file, saxon-js-parse-xml-bug.zip to a directory served up by a web server.
  2. Also make Saxon-JS 1.2.0 available there
  3. Edit test.html to adjust the path to Saxon-JS
  4. Open the url to test.html in a browser.
  5. Paste the markup below into the text area.
  6. Click Click Me
  7. Use the browser's Inspect Element to inspect the text "Where's my namespace?" Notice that the atom namespace has been preserved, but the <p> element has lost its namespace.
<atom:foo xmlns:atom="http://www.w3.org/2005/Atom">
   <html:p xmlns:html="http://www.w3.org/1999/xhtml">Where's my namespace?</html:p>
</atom:foo>

In my case, I'm taking user input (parsed and transformed) and making POST to a web service. The service's xsd expects the html part of the document to be in a namespace and rejects the request if it is not. Even if I transform the parsed input to match elements without a namespace and try to add the html namespace back on, when written out the namespace is still missing.


Files

saxon-js-parse-xml-bug.zip (3.33 KB) saxon-js-parse-xml-bug.zip David Cramer, 2019-03-23 00:29

Please register to edit this issue

Also available in: Atom PDF Tracking page