-2

I am new to XQuery. Can anyone explain how the debug process happens in XQuery?

For example, how to debug the below declaration:

declare
  %rxq:produces('*/*')
  %rxq:POST
  %rxq:path('/sstatement/(Report)/([^/]+)')
function ReportSupplement(
  $supplementType
, $submissionId
)

Please suggest any site for debugging XQuery.

Thanks in advance.

Ghislain Fourny
  • 6,971
  • 1
  • 30
  • 37
User2007
  • 7
  • 1

1 Answers1

0

A typical way to debug queries in XQuery is to use the trace function around expressions of interest, like a call to the function above in your case.

For example:

for $i in trace(1 to 3, "s")
return <element>{$i * trace($i, "i") }</element>

and to read the output in a separate log, documented by your engine.

In this case, it will look like:

s[1]: 1
i[1]: 1
s[2]: 2
i[1]: 2
s[3]: 3
i[1]: 3
Ghislain Fourny
  • 6,971
  • 1
  • 30
  • 37