[xquery-talk] node position

Howard Katz howardk at fatdog.com
Tue Jun 20 13:36:13 PDT 2006


You can also use positional variables in a for loop to say things like:

<books>
{
   for $book at $book-ix in $j/book
   return
   <book index="{ $book-ix }" >{ book/node() }</book>
}
</books>
 

 > -----Original Message-----
 > From: talk-bounces at xquery.com 
 > [mailto:talk-bounces at xquery.com] On Behalf Of John Snelson
 > Sent: June 20, 2006 9:08 AM
 > To: fatma helmy
 > Cc: talk at xquery.com
 > Subject: Re: [xquery-talk] node position
 > 
 > You'll be wanting to use positional predicates:
 > 
 > $j/bookstore/book[1]
 > $j/bookstore/book[2]
 > 
 > John
 > 
 > fatma helmy wrote:
 > > let $j:=<bookstore>
 > > <book> ....</book>
 > > <book> ....</book>
 > > </bookstore>
 > > 
 > > how to distinguish between book nodes suppose i have
 > > no dtd and no node attribute identifier. can i get the
 > > node position to order them 1 , 2 ,, etc
 > > 
 > > 
 > > 
 > > __________________________________________________
 > > Do You Yahoo!?
 > > Tired of spam?  Yahoo! Mail has the best spam protection around 
 > > http://mail.yahoo.com 
 > > _______________________________________________
 > > talk at xquery.com
 > > http://xquery.com/mailman/listinfo/talk
 > 
 > 
 > -- 
 > John Snelson, Berkeley DB XML Engineer
 > Sleepycat Software, Inc
 > http://www.sleepycat.com
 > 
 > Contracted to Sleepycat through Parthenon Computing Ltd
 > http://blog.parthcomp.com/dbxml
 > _______________________________________________
 > talk at xquery.com
 > http://xquery.com/mailman/listinfo/talk
 > 



More information about the talk mailing list