<?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>1249</bug_id>
          
          <creation_ts>2005-04-14 17:26:45 +0000</creation_ts>
          <short_desc>[XQuery] Is it too restrictive to only allow last path step to return atomic values?</short_desc>
          <delta_ts>2005-04-18 15:40: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>XQuery 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>Windows 2000</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</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="Henry Luo">henryluo</reporter>
          <assigned_to name="Don Chamberlin">chamberl</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>3746</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Luo">henryluo</who>
    <bug_when>2005-04-14 17:26:45 +0000</bug_when>
    <thetext>Under Section 3.2 Path Expressions,

There&apos;s a Note specifying that:
Since each step in a path provides context nodes for the following step, in 
effect, only the last step in a path is allowed to return a sequence of atomic 
values.

Is it too restrictive to only allow atomic values returned in last step?
It might be enough just require that Axis Steps preceed Filter Steps.

So that several steps of atomic value sequences can be used to create useful 
value sequences.
For example, (1, 2)/(.+1, .+2)/(.*2, .*3) gives a result sequence of
(4,6,6,8,6,9,9,12).
It&apos;ll be more tedious to write that in for expressions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3747</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-04-14 18:10:56 +0000</bug_when>
    <thetext>
We have had many discussions on this topic. The semantics of / does duplicate 
node elimination and document ordering, which is probably not what you want 
for atomic values. Since XQuery allows heterogeneous sequences of values and 
nodes, the question becomes what the semantics should be. The WG felt that 
this was not needed in v1 and I personally do not see a reason to revisit this 
if we want to ship XQuery in time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3752</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-04-14 20:23:34 +0000</bug_when>
    <thetext>As Michael Rys responded, the WGs spent a lot of time on this issue. A number of
people felt that there was a need for a &quot;simple mapping operator&quot; equivalent to

for . in SEQ1 return SEQ2

One syntax that was proposed was SEQ1!SEQ2. Overloading &quot;/&quot; to perform this
function is difficult because of the rule that &quot;/&quot; causes nodes to be delivered
in document order with duplicates eliminated. Allowing atomic values on the left
would also have the effect that the value of 10/5 is 5, which some WG members
found abhorrent. Hence the suggestion to use a different operator; but others
thought the very subtle distinction between the two operators would be too
confusing, and in any case, the new operator would offer insufficient usability
benefit over writing &quot;for $x in S1 return S2($x)&quot;. The decision to allow atomic
values on the right of &quot;/&quot; while still requiring nodes on the left is something
of a compromise but it happened to be the solution that got the most support.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3754</commentid>
    <comment_count>3</comment_count>
    <who name="Henry Luo">henryluo</who>
    <bug_when>2005-04-14 20:47:01 +0000</bug_when>
    <thetext>Thanks Michael, for the detailed explaination.
I can accept your answer.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>