The use of {curly brackets}

The fact that {} used by xQuery to mark an evaluated expressions within return clause creates a problem when the xml text contain curly brackets.
The following example:

replace input()/book/title
with The use of {curly brackets}

should currently be written as
replace input()/book/title
with The use of {‘{’}curly brackets{‘}’}

this enforces the xQuery programmer to use string operations search and replace etc.

there is therefore a need to better distinguish between xml data and xquery expressions (or a need for curly brackets equivalent entities).

The XQuery specification allows the brackets to be doubled to escape them:

Here is a left curly {{ and a right curly }}

Clearly, any delimiter character is going to give problems like this. The only other option would have been to use XML start and end tags in a special namespace - which is of course what XSLT does.

Michael Kay