[
Lists Home |
Date Index |
Thread Index
]
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
|