All of the cts queries serialize/deserialize as a feature of the server.
Placing a query into an element turns it into its xml representation,
and the cts:query() constructor turns the xml representation back into a
query.
let $cts-e as cts:query := cts:word-query("tilt", ("lang=en"), 1)
let $cts-e-q := <outside-tag>{$cts-e}</outside-tag>
let $cts-e2 := cts:query($cts-e-q/element())
return ($cts-e2, xdmp:describe($cts-e2))
On Thu, 2009-09-24 at 13:28 -0700, Paul M wrote:
> let $dc as element() := <fff>123</fff>
> let $dc-q := <outside-tag>{xdmp:quote($c)}</outside-tag>
> let $dc-qt := $dc-q/text()
> let $dc-uq as element():= xdmp:unquote($dc-qt,"","format-xml")/node()
>
> let $cts-e as cts:query := cts:word-query("tilt", ("lang=en"), 1)
> let $cts-e-q := <outside-tag>{xdmp:quote($cts-e)}</outside-tag>
> let $cts-e-qt := $cts-e-q/text()
> let $dc-uq as cts:query:=
> xdmp:unquote($cts-e-qt,"","format-xml")/node() cast as cts:query
> (:this does not work:)
>
>
> return $cts-e-q
>
> The $dc-uq stmt does not work. Cast exception. I am attempting to
> create general method to serialize any cts:query without using lib
> parser. Even possible? xdmp:quote works on any item,correct?
>
>
>
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general