[Bug 25149] Normative references to unstable documents must be removed before publication

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25149

C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #1 from C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com> ---
One complication arises regarding XSLT 3.0:  section 6 of Serialization defines
the (normatively required) process of namespace prefix normalization [1] by
appealing normatively to an XSLT 3.0 stylesheet.  As written, this stylesheet
is not a legal XSLT 2.0 stylesheet, because it uses the namespace axis in a
match pattern. 

[1] http://www.w3.org/TR/xslt-xquery-serialization-30/#PREFIXNORMALIZATION

One possibility would be to rewrite the stylesheet in XSLT 2.0; I think this is
possible.  A first attempt at such a rewrite follows.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:svg="http://www.w3.org/2000/svg"
  xmlns:mathml="http://www.w3.org/1998/Math/MathML">

  <xsl:template match="xhtml:*|svg:*|mathml:*">
    <xsl:element name="{local-name()}" namespace="{namespace-uri()}">
      <xsl:call-template name="copy-namespace-nodes"/>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
  </xsl:template>

  <xsl:template match="node()|@*">
    <xsl:copy copy-namespaces="no">      
      <xsl:call-template name="copy-namespace-nodes"/>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template name="copy-namespace-nodes">
    <xsl:for-each select="namespace::*
      [not(. = ('http://www.w3.org/1999/xhtml',
                'http://www.w3.org/2000/svg', 
                'http://www.w3.org/1998/Math/MathML'))]">
      <xsl:copy/>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

(Changes made:  remove namespace::* (etc.) from all select patterns; suppress
the template for the three magic namespaces; add the named template
'copy-namespace-nodes'; call that template from the two other templates.)

This is important enough and error-prone enough (I don't usually muck about
with namespace nodes in my stylesheets, so I'm out of practice) that it would
be a very good idea to have two or three additional pairs of eyes on this
before concluding that the new stylesheet is correct.  (Volunteers, please
check it and report your results in a comment on this bug.)

Another approach to the problem would be to embed the stylesheet in a note, on
the theory that the transformation is adequately described in the prose
definition of prefix normalization.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 26 March 2014 21:04:16 UTC