<?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>12455</bug_id>
          
          <creation_ts>2011-04-08 13:30:06 +0000</creation_ts>
          <short_desc>[XSLT 3.0] Predicates in new-style patterns</short_desc>
          <delta_ts>2014-05-15 14:00:33 +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>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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>47267</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-04-08 13:30:06 +0000</bug_when>
    <thetext>In 5.5.3 rules 5 and 6 we talk of an item &quot;satisfying a predicate&quot;. We don&apos;t say exactly what we mean by this. Examples are

~xs:integer[. gt 0]

(foo|bar)[baz]

There are two ways we could define it:

(a) we simply take the effective boolean value of the predicate

(b) we apply the usual rules for filter expressions, with the special interpretation of [position() = N] if the value is numeric.

Note that numeric predicates here have no practical utility, because the focus is always a singleton (position() is always 1). So we have a choice between a rule that is simple (a), or a rule that is consistent with elsewhere (b).

We might also want to reconsider the use of a singleton focus for a pattern like (foo|bar). It means that match=&quot;(foo|bar)[last()]&quot; does not do what the user probably expects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64289</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-02-19 21:46:48 +0000</bug_when>
    <thetext>This was discussed during the Feb 2012 F2F. It was felt we should try to restore the semantic connection between patterns and XPath expressions in order to avoid surprises in this area (or at any rate, to make it possible to defend the surprises).

I would suggest doing this as follows.

(a) the construct ~typename is replaced by (.[. instance of typename]). This substitution is incorporated into the definition of &quot;equivalent expression&quot;

(b) the ability to use union/intersect/except with non-node patterns is dropped

(c) the current rule

An item N matches a PathPattern if N is a node and the result of evaluating the expression root(.)//(EE) with a singleton focus based on N is a sequence that includes the node N, where EE is the equivalent expression to the PathPattern,

is replaced by

An item N matches a PathPattern if either of the following applies:

(1) N is a node and the result of evaluating the expression root(.)//(EE) with a singleton focus based on N is a sequence that includes the node N, where EE is the equivalent expression to the PathPattern,

(2) N is not a node and the result of evaluating the expression exists(EE) with a singleton focus based on N is true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65603</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-03-15 13:54:31 +0000</bug_when>
    <thetext>This change was accepted by th WG on 8 Mar 2011, and has been applied (with some editorial license).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>