Perform xquery works in the XQuery builder but not in the Xquery debugger - "Content is not allowed in prolog"
Posted: Thu Apr 16, 2020 1:08 pm
I have an XQuery expression which works in the Query builder, but when I try to do the same in the XQuery debugger I get the error message "Content is not allowed in prolog"
The XQuery is stored in a file "DDR_Text.lines_ListFileTOs.xquery"
It seems to be expecting the XQuery to be XML instead of a simple xquery string, and parsing it.
How can I get the XQuery debugger to behave the same as the XQuery builder?
Thanks for help through these teething troubles!
MrWatson
-------------
Code below:
arated by LF 
=> fn:string-join(' ')
The XQuery is stored in a file "DDR_Text.lines_ListFileTOs.xquery"
It seems to be expecting the XQuery to be XML instead of a simple xquery string, and parsing it.
How can I get the XQuery debugger to behave the same as the XQuery builder?
Thanks for help through these teething troubles!
MrWatson
-------------
Code below:
Code: Select all
(: 0. Output text instead of XML :)
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "text";
for $File in
(: 1. Drill down to each document of the DDR or use current doc :)
(/FMPReport/File/@link/doc(.) union doc('')[/FMPReport/@link])
(: 2. Drill down further to the required Catalog :)
/FMPReport/File
let $filename := replace($File/@name,"^(.+?)(\.\w+)?$","$1")
return
(
for $tablename in $File/RelationshipGraph[1]/TableList[1]
(: 3. Find all table occurences :)
/Table/@name ! concat($filename , '::' , data(.))
order by $tablename
return $tablename
(: 4. Prepend the file name onto each of them :)
)
(: 5. Output the results as a list sep

=> fn:string-join(' ')