That sample code isn't much help, because no one else can run it. Here's some 
sample code that works as expected in cq with 6.0-1.1, and doesn't have any 
external dependencies:

xquery version "1.0-ml" ;

cts:highlight(
  <p>hello world</p>, cts:word-query('world'),
  <strong>{ $cts:text }</strong>)
=>
<p>hello <strong>world</strong></p>

Verify that that works in your environment. Then start enhancing it to do what 
you need done, until it reproduces your error. Take small steps.

-- Mike

On 12 Oct 2012, at 07:06 , Kumar, Rajeev wrote:

> Hi All,
>  
> I am trying to implement highlight functionality using cts:highlight. Seems 
> like I am missing some configuration as already referred syntax and doesn’t 
> found anything strange.
> Below are the code snippet and error
>  
> Code:
> cts:highlight($song,$highlight,<strong>{ $cts:text }</strong>)
>  
> $song – gets value from fn:doc()
> $highlight – get dynamic value
>  
> Error:
> 500 Internal Server Error
> XDMP-UNDVAR: (err:XPST0008) Undefined variable $cts:text
> in /index.xqy, at 271:44, in local:song-detail() [1.0-ml]
>  
>  
> Thanks in advance for letting me know!
>  
> Note: line # 271 refers to the piece of code which I share.
>  
> Regards,
> Rajeev
>  
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

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

Reply via email to