Ah yes, thank you Christian. The XML syntax was what I was missing.
Now I just wrap my query like this: '<xquery><![CDATA[\n'+query+'\n]]></xquery>'
On Sun, Aug 18, 2013 at 12:55 AM, Christian Grün christian.gruen@gmail.comwrote:
Hi Gerald,
have you been defining your commands in a BaseX command script? In that case, you’ll now have to specify your queries in a single line or (better) use the XML syntax for multi-line queries, which could e.g. read as follows:
<xquery><![CDATA[ <Documents>{ for $doc in collection('oscrtest/documents/Photograph')/Document order by $doc/Header/TimeStamp descending return $doc }</Documents> ]]></xquery>
Hope this helps, Christian ___________________________
2013/8/17 Gerald de Jong gerald@delving.eu:
I am finding strange problems when I try using 7.7 which didn't appear before. I was building queries with XQUERY followed by \n and then the query, which worked in 7.6.
XQUERY
<Documents> { for $doc in collection('oscrtest/documents/Photograph')/Document order by $doc/Header/TimeStamp descending return $doc } </Documents>
Now it warns me about the syntax of my query: "Syntax: XQUERY [query]"
So then I take away the \n so that the query begins after "XQUERY " and
my
query becomes:
XQUERY <Documents> { for $doc in collection('oscrtest/documents/Photograph')/Document order by $doc/Header/TimeStamp descending return $doc }
</Documents>
upon which it reports:
"[XPST0003] Expecting closing tag </Documents>."
Puzzling about why this happens, I adjust the query to:
XQUERY <Documents>{ for $doc in collection('oscrtest/documents/Photograph')/Document order by $doc/Header/TimeStamp descending return $doc }</Documents>
but then it reports:
"[XPST0003] Expecting expression."
I will have to stick to 7.6 until I understand what to do about these problems.
What am I missing?
-- Delving BV, Vasteland 8, Rotterdam http://www.delving.eu http://twitter.com/fluxe skype: beautifulcode +31629339805
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk