<?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>1256</bug_id>
          
          <creation_ts>2005-04-19 08:34:52 +0000</creation_ts>
          <short_desc>[XPath] Error in example in 3.7 (distinct-values())</short_desc>
          <delta_ts>2005-05-05 00:12:12 +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>XPath 2.0</component>
          <version>Last Call 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>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</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>3764</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-04-19 08:34:53 +0000</bug_when>
    <thetext>The following example

for $a in fn:distinct-values(/bib/book/author)
return ($a, /bib/book[author = $a]/title)

does not produce the output illustrated. It returns a heterogenous sequence
containing strings (the result of atomizing an author element) and title
elements. The result of distinct-values() is an atomic sequence. The example
could be corrected to:

for $a in fn:distinct-values(/bib/book/author)
return (/bib/book/author[. = $a], /bib/book[author = $a]/title)

But I think it would be best to replace this example with a more realistic one:
in practice this problem would be tackled using xsl:for-each-group.

(Problem with this example was pointed out by Bob du Charme on the Saxon list.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3533</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-05-05 00:11:58 +0000</bug_when>
    <thetext>Michael,
Thanks for your comment. I have corrected the example in Section 3.7 as you 
suggested. I consider this to be an editorial correction. If you wish to 
suggest a specific alternative example, please send it to me.
Regards,
--Don Chamberlin</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>