<?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>1846</bug_id>
          
          <creation_ts>2005-08-15 09:49:47 +0000</creation_ts>
          <short_desc>[XSLT2.0] xsl:number applied to attributes and namespaces</short_desc>
          <delta_ts>2005-09-29 12:51:57 +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>XSLT 2.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</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="Michael Kay">mike</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>5406</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-08-15 09:49:48 +0000</bug_when>
    <thetext>If the &quot;from&quot; attribute of xsl:number is omitted, then the effect in XSLT 1.0 is
that numbering (for level=&quot;single&quot; and level=&quot;multiple&quot;) considers the entire
tree. The way we have phrased the rules in 2.0 is subtly different: we say that
if &quot;from&quot; is omitted, the effective value of &quot;from&quot; is the root of the tree, and
the nodes that we consider are those that are descendants-or-self of the root.

The effect of this is that we don&apos;t consider attribute and namespace nodes,
except in the special case that the attribute or namespace is parentless. The
consequence is that &lt;xsl:number/&gt; with no &quot;from&quot; or &quot;count&quot;, when applied to an
attribute node, returns &quot;1&quot; if the attribute is parentless, and () when it has a
parent. In XSLT 1.0, it always returned &quot;1&quot; (but don&apos;t try this in Saxon).

I think the cleanest fix for this would be that instead of considering only
descendants-or-self of $F (the innermost node that matches the &quot;from&quot; pattern),
we should consider all nodes that have $F as an ancestor-or-self (or
equivalently, we should consider descendants-or-self plus their attributes and
namespaces). That is, for level=&quot;single&quot; and level=&quot;multiple&quot;, we should change
the clause

Let $AF be the value of:

   $A intersect ($F/descendant-or-self::node())

to:

Let $AF be the value of

   $A[ancestor-or-self::node()[. is $F]]

 

In practice &quot;from&quot; is more important for level=&quot;any&quot;. Here the test is [. is $F
or . &gt;&gt; $F], which works fine for attribute and namespace nodes, so this case
does not need to be changed. 

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6306</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-09-15 22:19:31 +0000</bug_when>
    <thetext>The WG agreed to this change at its meeting on 15 September 2005. The spec has
been updated.

Michael Kay</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>