Project

Profile

Help

Bug #4858

closed

Namespace not serialized (wrapped DOM Node)

Added by Michael Kay over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DOM Interface
Sprint/Milestone:
-
Start date:
2020-12-16
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Reported today by email:

we just switched from saxon 9.9.1-7 to 10.3. We found an unexpected difference in a serialization of an element in the HTML default namespace ("http://www.w3.org/1999/xhtml"):

Consider the following fragment

1 <xsl:variable name="body" select="imf:parse-wiki(.,$value-format)" as="element(xhtml:body)"/>
2 <xsl:message select="namespace-uri($body)"/>
3 <xsl:sequence select="$body"/>

The function imf:parse-wiki() in (1) is a wrapper around an extension function, that produces a body element in the default xhtml namespace (i.e. no prefix). This is confirmed by the as-clause (no warnings/errors) as well as the statement (2) that shows http://www.w3.org/1999/xhtml in the console. However, the xsl:sequence statement in (3) produces the element without a default namespace ("

"), like:
<body xmlns:html="http://www.w3.org/1999/xhtml">
        <p>Dit type is in IMKAD gemodelleerd,......</p>
</body>

The extension function uses the DocumentWrapper() class, as per the following code:

a Node node = ((DOMSource)source).getNode();
b String baseURI = source.getSystemId();
c return = new DocumentWrapper(node.getOwnerDocument(), baseURI, configuration);

Hope this info is sufficient to pinpoint a possible flaw in 10.3 code. This issue did not exist in Saxon 9.9.1-7.

Thanks in advance!

Please register to edit this issue

Also available in: Atom PDF