[xquery-talk] Context node example

Michael Rys mrys at microsoft.com
Fri Jun 4 17:06:29 PDT 2004


Actually, an XQuery implementation can set the implicit context item in which case you could write number() as the query. For an example look at the SQL Server 2005 nodes() functionality or the SQL-200x SQL/XML XMLTable functionality.

Best regards
Michael

> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On Behalf
> Of Michael Kay
> Sent: Friday, June 04, 2004 3:38 PM
> To: 'Carmelo Montanez'; talk at xquery.com
> Subject: RE: [xquery-talk] Context node example
> 
> Well, there are only two ways of setting the context node in XQuery: E1/E2
> and E1[E2]. In the former case E2 has to be an expression that returns a
> node, which none of the functions that accept the context node as an
> implicit argument do. So if you want to construct examples that use these
> functions on the rhs of "/" you have to be pretty perverse, e.g.
> 
> value/remove(../*, number())
> 
> which ought to return the same as
> 
> remove(value/../*, number(value))
> 
> Michael Kay
> 
> > -----Original Message-----
> > From: Carmelo Montanez [mailto:carmelo at nist.gov]
> > Sent: 04 June 2004 18:57
> > To: Michael Kay; talk at xquery.com
> > Subject: RE: [xquery-talk] Context node example
> >
> > Hi Mike:
> >
> > Thanks.  Its that 0.0001% that is almost never used what
> > would interest me
> > the most.  However will try to use predicates to develop the tests.
> >
> > Carmelo
> >
> > At 07:51 PM 6/4/2004 +0100, Michael Kay wrote:
> > >In XQuery, these functions will almost always be used in a
> > predicate. For
> > >example
> > >
> > >//title[string-length() gt 10]
> > >
> > >or
> > >
> > >count((for $i in //price return substring-after(.,
> > "£"))[number() gt 10])
> > >
> > >Michael Kay
> > >
> > > > -----Original Message-----
> > > > From: talk-bounces at xquery.com
> > > > [mailto:talk-bounces at xquery.com] On Behalf Of Carmelo Montanez
> > > > Sent: 04 June 2004 17:49
> > > > To: talk at xquery.com
> > > > Subject: [xquery-talk] Context node example
> > > >
> > > > All:
> > > >
> > > > Anyone has a query example that uses one of the F&O functions
> > > > with the context node (if applicable)?.  I am just
> > looking for some
> > > > direction on the usage with the context node.  "fn:number"
> > > > for instance
> > > > will be a good one.
> > > >
> > > > Thanks,
> > > > Carmelo Montanez
> > > >
> > > > _______________________________________________
> > > > talk at xquery.com
> > > > http://xquery.com/mailman/listinfo/talk
> > > >
> >
> >
> 
> 
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk



More information about the talk mailing list