On 30/11/2011 13:09, Hans-Juergen Rennau wrote:
I encounter a problem with managing namespaces in an XSLT 2.0 stylesheet. Perhaps it is a bug, or I misread the spec.
This is a matter that has been taxing the Working Group. See


The text you are quoting was introduced by erratum XT.E37 (as mentioned in comment 6 of the bugzilla entry). But this was subsequently found to have problems (sadly the discussion moves to the member-only bug entry 937), and in consequence, I reverted the change in Saxon, which now behaves as described in the original 2007 version of the spec.

At the time of writing, the WG doesn't have a solution to this problem that gives satisfactory behaviour in all cases.

Michael Kay
The problem:
a) A literal result element is constructed, and its contents are (i) a newly constructed (default) namespace node, (ii) another literal result element
b) The serialization shows that the child element did not inherit the constructed namespace nodes: the default namespace is "reset" to null.
The spec says (5.7.1, point 12):
"If the newly constructed node is an element node, and if namespaces are inherited, then each namespace node of the newly constructed element (including any produced as a result of the namespace fixup process) is copied to each descendant element of the newly constructed element, unless that element or an intermediate element already has a namespace node with the same name (or absence of a name) or that descendant element or an intermediate element is in no namespace and the namespace node has no name."
Below a test stylesheet and its output. Why does the element <p:group> contain xmlns="" ?
Thank you for checking.
Kind regards,
<xsl:transform version="2.0" 
     xmlns:xsl="http:://www.w3.org/1999/XSL/Transform" "
   <xsl:template name="main">
         <xsl:namespace name="" select="'http://example.com2'"/>
         <p:group ref="abc"/>
<p:choice xmlns:p="http://example.com"   xmlns="http://example.com2"
   <p:group xmlns="" ref="abc"/>

All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.

saxon-help mailing list archived at http://saxon.markmail.org/