<?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>29976</bug_id>
          
          <creation_ts>2016-11-03 11:20:38 +0000</creation_ts>
          <short_desc>[FO31] Schema for fn:analyze-string allows outermost element to have mixed content</short_desc>
          <delta_ts>2016-12-16 19:55:19 +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.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</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>128030</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-03 11:20:38 +0000</bug_when>
    <thetext>The prose specification for fn:analyze-string says:

The function returns an element node whose local name is analyze-string-result. This element and all its descendant elements have the namespace URI http://www.w3.org/2005/xpath-functions. The namespace prefix is ·implementation-dependent·. The children of this element are a sequence of fn:match and fn:non-match elements. This sequence is formed by breaking the $input string into a sequence of strings, returning any substring that matches $pattern as the content of a match element, and any intervening substring as the content of a non-match element.

But the schema describes analyze-string-result-type with mixed=&quot;true&quot;, thus allowing an xsl:analyze-string element to have text node children. I believe this should be mixed=&quot;false&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128031</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-03 11:29:25 +0000</bug_when>
    <thetext>I guess one possible rationale for putting mixed=&quot;true&quot; here is that it makes it legitimate to take the atomizing value of the fn:analyze-string element, for example one can do:

substring-before(fn:analyze-string, (fn:analyze-string//fn:group[@nr=&apos;1&apos;]))

to get the text before the first captured group. (Atomizing an element with element-only content is not allowed, for paternalistic reasons.) I don&apos;t think that&apos;s a strong enough argument; though we might choose here to remain bug-compatible with 3.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128119</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-08 16:52:43 +0000</bug_when>
    <thetext>Decided to leave the schema saying mixed=&quot;true&quot;, but add a comment explaining the history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128156</commentid>
    <comment_count>3</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-11-11 14:02:01 +0000</bug_when>
    <thetext>Action A-660-04: Mike to add a note to F&amp;O to explain that the outermost element of fn:analyze string allows mixed content.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128159</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-11 14:54:01 +0000</bug_when>
    <thetext>The required Note has been added.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>