Hi,
following Christian's insinuation we're now abandoning XQJ and are porting our application to use the ClientSession API. I'm performing a textual replacement of the external variables in my XQuery expressions before sending them to BaseX's server. I'm facing difficulties with embedding character data in the XQuery expressions that are sent to the server.
Notably:
xquery <c-code>if (cond) { // a C comment }</c-code>
produces:
Stopped at line 1, column 33: [XPST0003] Expecting "}", found "C".
whereas:
xquery <c-code><![CDATA[ if (cond) { // a C comment } ]]></c-code>
produces:
<c-code> if (cond) { // a C comment } </c-code>
Is this a bug in BaseX? I thought that the use of CDATA is optional and required only if one wishes to avoid escaping <, >, & in PCDATA. If CDATA is required, I would have to convert my XML document in this way. The problem did not occur in the XQJ binding.
I haven't consulted the grammar; I'm following my intuition here that XQuery should allow embedded XML fragments. Is this not so?
- Godmar