This is how your XQuery snippet could look like:
<query xmlns="http://jax-rx.sourceforge.net"> <text><![CDATA[ insert node <snippet>to be inserted</snippet> into /updating/target ]]></text> </query>
Hope this helps, Christian
On Thu, Apr 21, 2011 at 4:53 PM, Computer Software Developer computer.software.developer@gmail.com wrote:
On 11/04/2011 17:11, Christian Grün wrote:
Instead, you'll either have to include your XML snippet in the XQuery Update expression
And I hoped to achieve that (including XML snippet in the XQuery Update expression) via a jax-rx variable in a query parameter (the equivalent in an HTTP Post, actually), which would then be accessed in the updating xquery stored on the server side via a variable. Is it possible that way?
Looking at the schema required for the HTTP post, it appears that the element named query, which is supposed to contain the xquery, can be replaced instead with the element named run. As an example, I had hoped this would work (XML in xmlSnippet variable):
<?xml version="1.0" encoding="iso-8859-1"?><run
xmlns="http://jax-rx.sourceforge.net%22%3E<text>updateDetails.xq</text><parameter name="output" value="media-type=application/xml"/><parameter name="output" value="encoding=iso-8859-1"/><parameter name="output" value="omit-xml-declaration=no"/><variable name="databaseName" value="MyData"/><variable name="xmlSnippet" value="<xml><data/></xml>"/></run>
In the example above, can the updateDetails.xq not retrieve the XML submitted via the variable xmlSnippet?