<?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>2339</bug_id>
          
          <creation_ts>2005-10-12 12:30:59 +0000</creation_ts>
          <short_desc>fn:string-join problem</short_desc>
          <delta_ts>2005-10-12 19:00:58 +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>Functions and Operators 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</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="J">jvh</reporter>
          <assigned_to name="Ashok Malhotra">ashok.malhotra</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>6678</commentid>
    <comment_count>0</comment_count>
    <who name="J">jvh</who>
    <bug_when>2005-10-12 12:31:00 +0000</bug_when>
    <thetext>From my point of view, by (hopefully) cautiously reading the spec,
the last example given for string-join is just wrong:

fn:string-join(for $n in ancestor-or-self::* return name($n), &apos;/&apos;)

shall return &quot;/doc/chap/section&quot;
and not      &quot;doc/chap/section&quot;

Why? I cannot see any reason why 
fn:string-join((&apos;&apos;, &apos;a&apos;, &apos;b&apos;), &apos;+&apos;) shall return &quot;a+b&quot;. It shall be &quot;+a+b&quot;!

If this is not a bug in the spec, it would be nice to put an example into
the spec and clarify the reason.





P.S.: the leading and trailing blank for the first two examples may confuse as 
well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6679</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-10-12 13:01:19 +0000</bug_when>
    <thetext>I believe the example is correct. I can&apos;t see why you think it is wrong. Perhaps
you read ancestor-or-self::* (which selects all element ancestors) as
ancestor-or-self::node() (which also selects the document node).

Michael Kay (personal response)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6680</commentid>
    <comment_count>2</comment_count>
    <who name="J">jvh</who>
    <bug_when>2005-10-12 15:03:34 +0000</bug_when>
    <thetext>Michael,
  you are correct! Its my fault, as in my special case (implementation)
we have no document node as the root node is just as normal as the others.
But nevertheless, it might be good idea to insert another example at
fn:string-join. Maybe

fn:string-join((&apos;&apos;, &apos;a&apos;, &apos;b&apos;), &apos;+&apos;) return &quot;+a+b&quot;

thank you for your quick reaction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6681</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-10-12 15:41:43 +0000</bug_when>
    <thetext>Whether or not your tree has a document node, ancestor::*/name() is going to
produce a sequence of non-empty names. It&apos;s only if your tree DOES have a
document node, and your XPath expression selects that node, that the sequence of
names will start with the string &quot;&quot;, and the result of string-join will then
start with the delimiter &quot;/&quot;.

Michael Kay</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>