[MarkLogic Dev General] query on fn:replace

Danny Sokolsky Danny.Sokolsky at marklogic.com
Thu Jun 3 17:21:22 PDT 2010


Hi Pragya,

Sorry, but I really do not understand what you are trying to ask here.

-Danny

From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Pragya Kapoor
Sent: Wednesday, June 02, 2010 10:48 PM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] query on fn:replace

Hi,

I have the following query:

I want the output as:

##Rented# House in ##Del#hi

Code:

Let $query := "Rented Del"
Let $tokens := fn:tokenize($query)

let  $y := "Rented House in Delhi"
let $count := 0
let $Title :=
        for $x at $count in $tokens

          let $x := fn:replace ($y,$tokens[$count], fn:concat("##", $tokens[$count],"#"),"i"),

        $count :=  $count + 1
  return $x
return
$Title


Thanks,
Pragya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20100603/860ce30b/attachment.html 


More information about the General mailing list