<?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>9838</bug_id>
          
          <creation_ts>2010-06-03 08:56:42 +0000</creation_ts>
          <short_desc>[XQ31ReqUC] Axes as functions</short_desc>
          <delta_ts>2014-05-20 17:04:42 +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>Requirements for Future Versions</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></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="Jim Melton">jim.melton</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>jonathan.robie</cc>
          
          <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>35928</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-06-03 08:56:42 +0000</bug_when>
    <thetext>In meeting 427 there was some discussion about the equivalence of axes and functions, and I was actioned (A-427-23) to summarize the discussion in a new Bugzilla entry so that it could be considered as a basis for enhancements for a future release. The discussion at meeting 427 is minuted at http://lists.w3.org/Archives/Member/w3c-xsl-query/2010Feb/0189.html (member-only link): see agendum J4.2.5.

First, we observe that the semantics of axes could be defined in terms of functions of the form fn:child(node()) -&gt; node()* (for some of the axes, the cardinality of the return type can be given more precisely than this). Making the axes available explicitly as functions would have a number of benefits:

(a) semantic clarity: it makes it clear that there&apos;s nothing magic about the semantics of axes

(b) it would make them available for use as function items that could be passed as parameters to higher-order functions or returned by higher-order functions.

(c) function composition involving axes would no longer require use of the &quot;/&quot; operator, which has reordering side-effects. For example one could write map(child#1, descendant(.)) to get the children of the descendants without reordering. Using function composition rather than path syntax might also be an attractive option for code generators.

Conversely the path notation a/b/c is attractive from a usability point of view in comparison with map(c, map(b, a)). It is already possible to use a function call as a step in a path expression of the form 

customer/f:cust-orders(.)/product-code/f:product-for-code(.)/price

However, the asymmetry here between built-in navigational functions (the 13 axes) and user-defined navigational functions is striking. Allowing axis notation (including node tests) for user-defined navigational steps would add symmetry. The above could then be written

customer/f:cust-orders::*/product-code/f:product-for-code::*/price

Here I have used a node-test of &quot;*&quot;, but of course any node test could be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106491</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-05-20 17:04:42 +0000</bug_when>
    <thetext>Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>