RE: [transquery-discuss] kick off discussion

From: Evan Lenz (elenz@xyzfind.com)
Date: Tue Dec 04 2001 - 09:44:29 CET


Jim Fuller wrote:
> question 1: the documentation is very unclear as to 'what' transquery
> is......pls excuse my ignorance but could i have a .02 euro
> tranform of the
> following paragraph taken from the spec into neanderthal speak.
>
> 'TransQuery comprises a small, flexible set of XSLT conventions and
> processing model constraints that enable the use of XSLT as a
> query language
> over multiple XML documents.'

The only thing TransQuery really "enables" is an interoperable way of
accessing multiple documents by agreement between vendors on a single name
to give to a collection of documents as input. The name in the current
TransQuery spec is {http://www.xmlportfolio.com/transquery}input, i.e. local part "input" and
namespace URI "http://www.xmlportfolio.com/transquery".

> i quess i need to 'see' things

The spec indeed should include an example. Here's what an example use of
this name might look like:

<xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:tq="http://www.xmlportfolio.com/transquery">

  <xsl:param name="$tq:input"/>

  <xsl:template match="/">
    <xsl:copy-of select="$tq:input//purchaseOrder[paid='yes']"/>
  </xsl:template>

</xsl:transform>

The name is used as the name of a top-level parameter (whose value is bound
outside of the stylesheet by the XSLT processor's external API). What prefix
you use is immaterial. The value of the parameter must be a node-set
consisting of zero or more root nodes. The value may not be a string,
number, or boolean, and the node-set may not contain any other kind of node
other than root node. Note that this is the same type of value returned by
XSLT's document() function (zero or more root nodes).

The benefit of this is that it allows the stylesheet writer to access
multiple unnamed documents. The source tree, or unary "/", represents only
one unnamed
document. $tq:input represents a collection of unnamed documents.

Note: I'm using "unnamed" only to mean that the stylesheet writer doesn't
need to know the URIs of the input documents in order to access them.

> question 2: correct the following statement
>
> Transquery is formally constructed XSLT that will comprise a
> rigorous method
> of querying data, in other words XSLT is probably abused today as it is
> being used in certain data querying situations where XQuery should be
> employed.

No, TransQuery doesn't directly address query optimization or even the way
that XSLT is used beyond the introduction of the simple mechanism described
above. In this sense, TransQuery might be less than meets the eye at first
glance.

> or
>
> Transquery is a processor of some sort, as attributed to the java
> code up at
> sorceforge now.... which of course makes more sense.

The SF project has a simple server program that uses an existing XSLT
processor (SAXON). It uses HTTP for its external interface, so there are
definitely some design decisions that were made outside the scope of what
TransQuery addresses. With respect to TransQuery, it enforces the rule that
{http://www.xmlportfolio.com/transquery}input always be bound to a document collection (i.e.
a set of root nodes). In the case of this implementation, that value always
consists of the collection of all "stored" documents, but it doesn't have to
be that way.

> in any event, the idea of a migration or in between solution from XSLT to
> XQuery is interesting

This is one reasonable characterization of what TransQuery provides. The
"trans" in "TransQuery" (though ostensibly for TRANSformations) could also
be interpreted as TRANSition (from XSLT 1.0 to XSLT 2.0/XQuery). TransQuery
provides an immediately usable spec that in turn can provide real-world
experience and feedback to the W3C XSL and XML Query Working Groups.

I hope this helps. Please keep the questions and comments coming!

Evan Lenz



This archive was generated by hypermail 2.1.4 : Fri Feb 22 2002 - 11:35:58 CET