1

cts:uri-match("/pattern*.xml", ("limit= {$limit} ") --> this throws an error

Is there a way to pass the limit value as variable($limit)?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
anuj_gupta
  • 131
  • 4

1 Answers1

0

Inside of a quoted string literal you can't start a code block.

Alternative solutions to achieve what you want:

You can use the concat() function:

let $limit := 100
return
  cts:uri-match("/pattern*.xml", concat("limit=", $limit) ) 

You can concatenate with the || operator:

let $limit := 100
return
  cts:uri-match("/pattern*.xml", "limit="||$limit) 
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147