[xquery-talk] Except in XQuery

padmapriya ayyagari asn.padmapriya at gmail.com
Mon Jan 17 03:28:49 PST 2005


I'm trying the following implementation for some kind of deep-except,
wherein a branch of an xml document is removed.

define function myExcept($n,$omit){

        for $c in ($n/child::node() except $omit)
                element{name($c)} {$c/@*, $c/text(), fn:myExcept($c,$omit)}

If i say myExcept(fn:doc("xmark.xml")/*,fn:doc("xmark.xml")/site/people/person/watches/watch),
it returns the correct result, along with
<site><people><peson><watches><watch></site></people> ...
basically an empty element corresponding to the branch that has been
removed. Why do you think this is happenign?

By the way, I'm using Galax 0.3.1. 


More information about the talk mailing list