Hi ,

I have following query:

<suggestions>&lt;suggestion&gt;&lt;title 
&gt;ABC&lt;emph&gt;certIfi&lt;/emph&gt;CATE&lt;/title  
&gt;&lt;text&gt;&lt;emph&gt;certIfi&lt;/emph&gt;CATE&lt;/text&gt;&lt;/suggestion&gt;</suggestions>

I am getting output as above. My <> tag replaced by &lt; and &gt;
Let    $strsearch := "certIfi"
let $suggestions := search:search($search,$options)
for $suggestion at $index in $suggestions

    return
    let $TitleNode := element title { $suggestion/ title/text()},
        $searchTextNode := element text { $suggestion/text/text()}
    let $SuggestionNode := element suggestion{$TitleNode,$TextNode}
    let $boldText := <emph>{$strsearch}</emph>
    let $result := fn:replace(xdmp:quote($SuggestionNode), $strsearch , 
xdmp:quote($boldText),"i")
return
   $result

I tried with xdmp:unquote($result) but this is not working.
This give onlt text without any xml tags:
ABC certiFICATEABC certiFICATE

And if I call this xqy module from xcc API I get following error:
XDMP-DOCSTARTTAGCHAR: xdmp:unquote("<suggestion><title 
>ABC<emph>certifi</emph>..") - Unexpected character "<" in start tag at  line 1

Also I don't want to use cts:highlight as it only highlight the word query 
whereas I am looking for character highlighting.

Query       output

A           <emph A </emph> ll is well

Al          <emph> Al </emph> l is well

Be          All the <emph> Be </emph> st

Best        All the <emph> Best </emph>


Please let me know, If I am missing anything.

Thanks,
Pragya

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to