On 30/11/2011 13:09, Hans-Juergen Rennau wrote:
Hello,
 
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

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5857

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
Saxonica
 
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,
Hans-Juergen
 
Stylesheet:
 
<xsl:transform version="2.0" 
     xmlns:xsl="http:://www.w3.org/1999/XSL/Transform" "
     xmlns:p="http://example.com"/>
   <xsl:template name="main">
      <p:choice>
         <xsl:namespace name="" select="'http://example.com2'"/>
         <p:group ref="abc"/>
      </p:choice>
   </xsl:template>
</xsl:transform>
 
Output:
<p:choice xmlns:p="http://example.com"   xmlns="http://example.com2"
   <p:group xmlns="" ref="abc"/>
</p:choice>


------------------------------------------------------------------------------
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.
http://p.sf.net/sfu/splunk-novd2d


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help