RE: [XQueryX] 5 A Trivial Embedding of XQuery

> It is the suggestion that sometimes you need to do that and sometimes
> you don't that makes this problematic.

[Michael Rys] I agree that you always should entitize XQueries in the
trivial embedding...

> > Also, embedding XQuery queries by wrapping them with CDATA sections
> clearly
> > doesn't work when a query contains the sequence ]]>
> 
> You can't put the sequence ]]> in an XML file anyway it's not just
that
> you can't wrap a CDATA section around it, that sequence isn't legal
> anywhere (except ending a cdata section.

[Michael Rys] This is clearly incorrect. An XML document clearly can
contain ]]>. 

> An embedding of xquery into XML that is safe and reversible is
> replace each of < & and > by &lt; &amp; &gt; place resulting string in
> XML element.
> Extract element content (not its linearisation) and parse as Xquery.
> 
> That is essentially what you do for Xpath anyway. The danger is the
> suggestion that unless there are < being used as < (rather than
element
> constructors) the Xquery can be directly placed in the XML.
> 
> David
> 
> 
> --
> http://www.dcarlisle.demon.co.uk/matthew
> 

Received on Wednesday, 14 January 2004 16:50:34 UTC