[xquery-talk] 'except' in XQuery

padmapriya ayyagari asn.padmapriya at gmail.com
Tue Jan 11 11:48:11 PST 2005


Hi,

I tried :

for $n in fn:document("docs/xmark.xml")//*
return $n//* except ($n/people/person)

But it still returns the 'person' element along with it's children.

Padmapriya


On Tue, 11 Jan 2005 08:37:04 -0500, Joel Stewart
<stewajc_0720 at hotmail.com> wrote:
> 
> 
> I think except only works on a sequence.  So far, I can only do an except
> for a particular nodes children, e.g.
> 
> <b_filtered>
> 
> {
> 
> for $child in ("doc.xml")/a/b 
> 
> return $child/* except ($child/c) 
> 
> }
> 
> </b_filtered>
> 
> Extra credit for anyone able to come up with a generic method to strip out
> all occurances of any series of paths.  e.g. 
> 
> filter($mynode, ("//div", "//h4"))
> 
>  
> 
> 
>  
> >From: padmapriya ayyagari <asn.padmapriya at gmail.com> 
> >Reply-To: padmapriya ayyagari <asn.padmapriya at gmail.com> 
> >To: talk at xquery.com 
> >Subject: [xquery-talk] 'except' in XQuery 
> >Date: Tue, 11 Jan 2005 05:15:42 -0500 
> > 
> >Hello everyone, 
> > 
> >I want to output all the parts of an XML document except those that 
> >satisfy a particular xpath expression. I'm trying to do this by 
> >writing: 
> > 
> >fn:document("docs/xmark.xml")/fn:document("docs/xmark.xml")//* except 
> >fn:document("docs/xmark.xml")/site/people 
> > 
> >But I still get the nodes that satisfy /site/people. Is there a 
> >problem with my xquery syntax?? I've also tried '/*' instead of '//*' 
> >but to no avail. 
> > 
> >Thanks, 
> >Padmapriya 
> >_______________________________________________ 
> >talk at xquery.com 
> >http://xquery.com/mailman/listinfo/talk 
>


More information about the talk mailing list