This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XQuery (was Designs for XSLT functions)


Michael Kay wrote:
> 
> > Forgive my ignorance, but does XQuery provide queries across
> > a set of XML
> > documents? In other words you have a 'database' of XML
> > documents and it
> > returns all the documents or part of all the documents matching some
> > criteria.
> 
> If I understand the thinking correctly, it is that a database would be
> represented by a virtual document containing a list of the instance
> documents, identified by URL; and then yes, you should be able to search
> this entire collection. Of course XSLT has that capability too (in theory):
> the real challenge is designing optimizers that can take advantage of
> persistent indexes, etc.
> 

Most of the examples in XQuery use the document function to apply the
query to a particular document and it isn't really obvious that document
collection functionality exists.

In XQuery any query that begins with / or // represents an implicit root
node determined by the environment in which the query is invoked. So if
you have a query like //some/xpath it is up to the executing process to
determine how that query is applied. For instance dbXML is an XML
database and stores XML documents in collections. We can provide a
collection level query mechanism that takes an XQuery expression and
returns a list of nodes coming from all documents in the collection. The
result can then be formatted in the RETURN clause. 

I do agree though, that other then this specific case when you step back
and look at the functionality provided by XSLT and XQuery there is an
awful lot of overlap. Even in the collection case you could certainly
write an XSLT engine that evaluates all XPaths in a collection context
rather then a document context and would solve the same problem. That
wouldn't really be standard XSLT but would be standard XQuery. The key
really is if you can map XSLT back to the XQuery algebra, if you can do
that then XSLT is a perfectly valid XQuery language. Of course to do
that you have to understand the algebra first...


> Mike Kay
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
Kimbro Staken
Chief Technology Officer
dbXML Group L.L.C
http://www.dbxmlgroup.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]