parse-xml() in Saxon-JS loses html namespace
- Unzip the attached zip file, saxon-js-parse-xml-bug.zip to a directory served up by a web server.
- Also make Saxon-JS 1.2.0 available there
- Edit test.html to adjust the path to Saxon-JS
- Open the url to test.html in a browser.
- Paste the markup below into the text area.
- Click Click Me
- 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.
Please register to edit this issue