[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath 2.0 - how much of XQuery should it include?


xquery include
At 08:07 PM 5/13/2002 +0100, Jeni Tennison wrote:
>Hi Jonathan,
>
> >>I was thinking of something much more simple -- a simple parameter
> >>marker (?) that allows you to pass in values a la SQL:
> >>
> >>    FOR $book IN document("catalog.xml")//book
> >>       WHERE $book/author = ?
> >>    RETURN $book
> >
> > How is this different from a variable?
> >
> > define function book-by-author(element author $a)
> > {
> >     for $book in document("catalog.xml")//book
> >     where $book/author = $a
> >     return $book
> > }
>
>So when you perform a query, do you tell the XQuery processor to
>evaluate a particular function with particular arguments, and give you
>the result? I'd really like to learn more about how XQuery processors
>get invoked.

That is very much implementation defined. I am fairly certain that many 
implementations will be able to define variables in the invocation that can 
be accessed in a query.

>As you probably know, in XSLT 1.0 you declare global parameters and
>pass in values for those, along with the node that you want processed,
>and it finds the template and uses the global parameters. The latest
>XSLT 2.0 WD changes this model -- now you can also invoke a stylesheet
>by passing in a sequence of nodes and the name of a template, and that
>template gets called. Which is an interesting move. I guess that it
>will mean that:
>
><xsl:template match="/" name="main">
>   <wrapper>
>     <xsl:apply-templates select="input()" mode="mymode" />
>   </wrapper>
></xsl:template>
>
>will become a common pattern.

Yes, input() is defined in XQuery as well. It's pretty important when you 
want to be able to write a query without knowing the data sources in advance.

> > What is still missing from the spec is a way to define and load
> > modules. That's important functionality, IMHO.
>
>Yes, I'd agree with that. It's certainly important in XSLT in any
>case, and I think it will become more so as function libraries become
>more important.

The proposals are sitting there waiting to be considered as soon as we kill 
the current set of important issues....

Jonathan


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.