<?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>4949</bug_id>
          
          <creation_ts>2007-08-14 18:21:54 +0000</creation_ts>
          <short_desc>[FO] Suggested extension to fn:replace (first match only)</short_desc>
          <delta_ts>2009-10-12 22:11:35 +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>Working 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>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Don Chamberlin">chamberl</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>16146</commentid>
    <comment_count>0</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-08-14 18:21:54 +0000</bug_when>
    <thetext>The EXSLT community (http://exslt.org/) has defined an XSLT function named 
regexp:replace() (http://exslt.org/regexp/functions/replace/index.html) 
which is similar in purpose to our function fn:replace(). The two 
functions have different signatures and slightly different semantics. 
EXSLT&apos;s regexp:replace() function supports a flag that sets its behavior 
to replace-all-matches vs. replace-first-match-only (fn:replace() 
currently supports only the first of these behaviors and has no 
corresponding flag.)

For users of the EXSLT function who wish to migrate to XQuery or XSLT 2.0, 
it would be helpful to add an additional flag to fn:replace() that 
provides similar functionality. I request that the joint working groups 
consider this additional parameter as a possible future extension to 
fn:replace().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17773</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-11-16 09:33:52 +0000</bug_when>
    <thetext>Enhancement request: Recategorized under F+O version 1.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24078</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-03-06 10:30:14 +0000</bug_when>
    <thetext>I believe this requirement is satisfied by the new analyze-string() function.

For example, to wrap parentheses around the first sequence of numeric digits in a string, one could write:

let $x := analyze-string($in, &apos;\d+&apos;)
return string-join(
  for $s in $x
  return (if ($s is $x/match[1]) then concat(&apos;(&apos;, ., &apos;)&apos;) else string(.))

I am accordingly marking this as fixed; please feel free to reopen if you feel this is not an adequate solution to the requirement. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28280</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-10-12 22:11:35 +0000</bug_when>
    <thetext>Since the requested functionality is provided by the new analyze-string() function, I am marking this closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>