From: Gary L. <gar...@en...> - 2008-04-23 22:39:19
|
> Assuming your predicate selects some document-nodes and 'root' is the > name of the outermost-element... > collection('/db/my-collection)/root[predicate][1] I tried something like this but it returns the first /root of every doc in the collection. I ended up creating a sequence of doc IDs that matched with the predicate and then used the first ID to select the doc. Thanks, gary > > On 24/04/2008, at 3:32 AM, Gary Larsen wrote: > > > > > With XQuery I'm trying to find a single document in a collection > > which matches some criteria: > > > > collection('/db/my-collection)/root[predicate] > > > > Is there a sequence that I can use here like [1] or another way to > > just get the first matching doc? > > > > Thanks, > > gary > > ------------------------------------------------------------------------ > - > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save > > $100. > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/jav > aone_______________________________________________ > > Exist-open mailing list > > Exi...@li... > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/jav > aone > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open |