<?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>30396</bug_id>
          
          <creation_ts>2019-01-22 13:00:56 +0000</creation_ts>
          <short_desc>[XSLT30] patterns like &quot;descendant::para&quot; don&apos;t match parentless nodes like &quot;child::para&quot; does, there&apos;s no descendant-or-top rule</short_desc>
          <delta_ts>2019-02-20 10:31:00 +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 3.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.online</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>129486</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2019-01-22 13:00:56 +0000</bug_when>
    <thetext>In XSLT 3.0 we allowed &quot;descendant::&quot;, but the rewrite rules like we have for &quot;child::&quot; was not updated.

We also allowed the &quot;namespace::&quot;, &quot;descendant-or-self::&quot; and &quot;self::&quot; axis, but for the namespace axis a rule was added. For self (and by extension, descendant-or-self) there&apos;s no conflict with selecting the top node of a parentless tree.

As written, &quot;descendant::para&quot; would not match a parentless para element, but &quot;child:para&quot; would. I don&apos;t think that it the intention of the spec here.

I propose therefore an erratum entry where we introduce the same concept as child-or-top, but for the descendant axis: descendant-or-top.

Alternatively, we could simply say: &quot;where &quot;descendant::x&quot; is used, replace it with &quot;descendant-or-self::x&quot;, which would have the same effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129487</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2019-01-22 16:40:12 +0000</bug_when>
    <thetext>The peculiar rule for child-or-top and attribute-or-top was introduced in 2.0 to ensure that 1.0 patterns like &quot;title&quot; and &quot;@version&quot; had the intuitive effect in the presence of parentless elements and attributes. The idea was that people would expect these to match ANY element or attribute with the relevant name.

I don&apos;t think there&apos;s a similar intuitive expectation that descendant::title should match title elements that aren&apos;t the descendant of anything. Quite the contrary.

But it doesn&apos;t really matter what I think. The spec is clear about what descendant::title means, and whether we like the semantics or not, there is no justification for attempting to make a change now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129489</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2019-02-02 14:49:18 +0000</bug_when>
    <thetext>Interesting, I really thought this was an omission considering how the rest of the text was written.

In non-pattern expressions, child::x fully overlaps with descendant::x. In patterns this is no longer true and these sets are disjunct, child::x includes the top node, descendant::x does not. Saying that child::x selects top and saying descendant::x does not does not sound intuitive to me all, to be honest (but I have always stumbled on the &quot;automatic top selection&quot;).

But I see your argument, it didn&apos;t occur to me that this was specifically intended this way, which is good (though I find it odd, that is not a good enough argument to break open the REC). I had no intention to propose a change, just thought it was an omission.

I propose this bug as invalid.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>