<?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>21671</bug_id>
          
          <creation_ts>2013-04-11 22:36:26 +0000</creation_ts>
          <short_desc>[FO30] analyze-string examples</short_desc>
          <delta_ts>2013-06-17 16:48:29 +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 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Eisenberg">andrew.eisenberg</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>85997</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2013-04-11 22:36:26 +0000</bug_when>
    <thetext>The examples in section 5.6.5 fn:analyze-string start with:

&quot;The expression fn:analyze-string(&quot;The cat sat on the mat.&quot;, &quot;\w+&quot;) returns &lt;analyze-string-result xmlns=&quot;http://www.w3.org/2005/xpath-functions&quot;&gt; &lt;match&gt;The&lt;/match&gt; &lt;non-match&gt; &lt;/non-match&gt; &lt;match&gt;cat&lt;/match&gt; &lt;non-match&gt; &lt;/non-match&gt; &lt;match&gt;sat&lt;/match&gt; &lt;non-match&gt; &lt;/non-match&gt; &lt;match&gt;on&lt;/match&gt; &lt;non-match&gt; &lt;/non-match&gt; &lt;match&gt;the&lt;/match&gt; &lt;non-match&gt; &lt;/non-match&gt; &lt;match&gt;mat&lt;/match&gt; &lt;non-match&gt;.&lt;/non-match&gt; &lt;/analyze-string-result&gt;.&quot;

Not very readable. I suggest that you add:

Indented for readability, this result is:

&lt;analyze-string-result xmlns=&quot;http://www.w3.org/2005/xpath-functions&quot;&gt;
   &lt;match&gt;The&lt;/match&gt;
   &lt;non-match&gt; &lt;/non-match&gt;
   &lt;match&gt;cat&lt;/match&gt;
   &lt;non-match&gt; &lt;/non-match&gt;
   &lt;match&gt;sat&lt;/match&gt;
   &lt;non-match&gt; &lt;/non-match&gt;
   &lt;match&gt;on&lt;/match&gt;
   &lt;non-match&gt; &lt;/non-match&gt;
   &lt;match&gt;the&lt;/match&gt;
   &lt;non-match&gt; &lt;/non-match&gt;
   &lt;match&gt;mat&lt;/match&gt;
   &lt;non-match&gt;.&lt;/non-match&gt;
&lt;/analyze-string-result&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86019</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-04-12 06:58:16 +0000</bug_when>
    <thetext>Probably makes sense. I was compromising here between the need for human readability and the desire to have as many of the examples as possible be automatically testable, since experience shows that examples that are not machine-testable are often wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89402</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-06-17 16:48:29 +0000</bug_when>
    <thetext>I have added an attribute fos:result normalize-space=true&quot; to the function catalog schema to identify example results that need to be formatted with whitespace; I have added the relevant logic to the stylesheet; and I have used this mechanism to format these examples.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>