<?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>5464</bug_id>
          
          <creation_ts>2008-02-08 14:37:11 +0000</creation_ts>
          <short_desc>[XSLT 2++] Enhancement: generalizing patterns</short_desc>
          <delta_ts>2014-05-15 14:00:27 +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 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>18880</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-02-08 14:37:11 +0000</bug_when>
    <thetext>Path expressions became a lot more flexible in XPath 2.0, but little of this flexibility was passed on to XSLT patterns. Some patterns which we don&apos;t currently allow, but which could be very useful:

(chapter//footnote)[1]

book/(chapter|appendix)

node() except element()

We should review the subset of XPath syntax that is allowed in XSLT patterns and only prohibit constructs where there is a good reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21767</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-09-03 08:40:35 +0000</bug_when>
    <thetext>Some specific suggestions for enhancements:

(a) allow a variable reference at the start of the pattern, for example $lookup//data. Can be written currently as data[ancestor::node() intersect $lookup], but that&apos;s pretty cumbersome. Useful to specify that a template rule is applicable only to one specific document.

(b) this also allows match=&quot;$nodeset&quot; where $nodeset is a global variable. The pattern then matches all nodes in this nodeset. Useful in cases where it is easier or more efficient to select some set of nodes (often those to be treated as exceptions) in a global variable. I&apos;ve seen this in WordXML documents: &quot;ignore the first w:d element after any w:img element that has a w:text descendant&quot;, etc.

(c) allow the first step to be a call on doc() or document(). Achieves the same thing but without the need for a global variable.

A more radical idea is to allow the match pattern of an xsl:template to reference the template parameters. So if the xsl:apply-templates specifies &lt;xsl:with-param name=&quot;color&quot; select=&quot;&apos;red&apos;&quot;/&gt; then a template with match=&quot;*[$color=&apos;blue&apos;]&quot; will not be selected. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22050</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-09-26 13:22:07 +0000</bug_when>
    <thetext>*** Bug 5840 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24385</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-03-24 08:24:19 +0000</bug_when>
    <thetext>Another one that comes up (see Christian Roth on xsl-list today) is to match the first descendant of something, e.g. chapter/descendant::para[1] or (chapter//para)[1]. Neither syntax is currently allowed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25019</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-05-07 09:46:50 +0000</bug_when>
    <thetext>A proposal for patterns to match atomic values is at

http://lists.w3.org/Archives/Member/w3c-xsl-wg/2009Apr/0070.html

(member-only link)

It does not address all the requirements raised here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35070</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-04-15 16:47:54 +0000</bug_when>
    <thetext>This is done in the current (internal) working draft</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>