<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20261</bug_id>
          
          <creation_ts>2012-12-06 09:21:47 +0000</creation_ts>
          <short_desc>[SER30] Usability problem with XHTML 5.0 prefix stripping</short_desc>
          <delta_ts>2013-01-22 18:34:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Serialization 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Henry Zongaro">zongaro</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79530</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-12-06 09:21:47 +0000</bug_when>
    <thetext>Bullet 4 in the second bullet list in section 6 states, inter alia:

It is a serialization error [err:SERE0020] if the element node has a namespace node for the default namespace whose value is not equal to the namespace URI of the element node.

This seems to imply that it is impossible to serialize the following perfectly reasonable document:

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
   &lt;head&gt;&lt;title&gt;Heading&lt;/title&gt;&lt;/head&gt;
   &lt;body&gt;
     &lt;div&gt;
       &lt;s:svg xmlns:s=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;&gt;
          &lt;s:circle cx=&quot;100&quot; cy=&quot;50&quot; r=&quot;40&quot; stroke=&quot;black&quot; 
              stroke-width=&quot;2&quot; fill=&quot;red&quot;/&gt;
       &lt;/s:svg&gt;
    &lt;/div&gt;
   &lt;/body&gt;
&lt;/html&gt;

because the svg element violates this rule. Surely this is not intended?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79532</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-12-06 09:35:04 +0000</bug_when>
    <thetext>A related problem: the rule also states &quot;The serializer MUST serialize a default namespace declaration for the namespace, unless a default namespace declaration for the same namespace URI is already in scope for the element in the serialized result.&quot; but fails to say that this namespace declaration must be cancelled on any descendant elements that use a different default namespace or none.

I would propose solving these issues by describing the process differently. The XHTML 5.0 serializer should apply the following transformation to the result tree prior to serialization:

&lt;xsl:template match=&quot;xhtml:* | svg:* | mathml:*&quot;&gt;
  &lt;xsl:element name=&quot;{local-name()}&quot; namespace-uri=&quot;{namespace-uri()}&quot;&gt;
    &lt;xsl:copy-of select=&quot;@*&quot;/&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:element&gt;
&lt;/xsl:template&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79927</commentid>
    <comment_count>2</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2012-12-11 16:14:49 +0000</bug_when>
    <thetext>I think your proposed transformation looks reasonable at first glance.

Speaking for myself, of course, not the working groups.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81329</commentid>
    <comment_count>3</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2013-01-14 10:59:40 +0000</bug_when>
    <thetext>Michael, at their joint teleconference of 18 December 2012,[1] the XSLT and XQuery Working Groups decided to revise the Serialization 3.0 document along the lines that you&apos;ve proposed in comment #1.

As you were present when this decision was made, I trust you agree with it, and I will mark the bug as CLOSED.

[1] https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Dec/0054.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81400</commentid>
    <comment_count>4</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2013-01-15 15:41:14 +0000</bug_when>
    <thetext>Michael, I have applied changes to the latest member-only Serialization 3.0 draft, primarily to section 6,[2] that I hope remedy this bug to your satisfaction.  I attempted to improve the description of stripping prefixes in prose and added an XSLT stylesheet that I hope is equivalent to that description.

If it satisfactorily resolves the issue, I will then create an equivalent XQuery expression.

I would be grateful if you could have a look.

These changes also fix the problem reported in the first comment of bug 20251.[3]

[2] https://www.w3.org/XML/Group/qtspecs/specifications/xslt-xquery-serialization-30/html/Overview.html#xhtml-output
[3] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20251#c1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81443</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-15 22:20:53 +0000</bug_when>
    <thetext>I suspect that in this template

  &lt;xsl:template match=&quot;node()|@*|namespace::*&quot;&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select=&quot;@*|namespace::*|node()&quot;/&gt;
    &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;

the xsl:copy should say copy-namespaces=&quot;no&quot;, as the whole point of the template is to be selective about which namespace nodes are copied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81485</commentid>
    <comment_count>6</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2013-01-16 14:57:09 +0000</bug_when>
    <thetext>Michael, thanks for spotting that omission.  My XSLT neurons have atrophied after a year of disuse!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81957</commentid>
    <comment_count>7</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2013-01-22 18:34:29 +0000</bug_when>
    <thetext>Michael, I have updated the Serialization draft to add the &quot;copy-namespaces&quot; attribute to the xsl:copy, as you suggested.  I had also added an XQuery equivalent, but have since removed it, as directed by the XSLT and XQuery working groups in their joint teleconference of 22 January 2013.[4]

The latest internal draft of Serialization 3.0 contains these changes.

[4] https://lists.w3.org/Archives/Member/w3c-xsl-query/2013Jan/0073.html (Member-only link.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>