TransQuery Specification

Evan Lenz

This version: 09 Jan 2002

Latest version: http://www.xmlportfolio.com/transquery/specification

Revision History
Revision 0.209 Jan 2002
Removed the "meta-document" convention. Cleaned up and simplified.
Revision 0.125 Oct 2001
First draft.

Abstract

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. This is a working draft for version 1.0 of TransQuery.


Table of Contents

Introduction
TransQuery Input
Conformance
XSLT Stylesheets
XSLT Processing Models
XSLT Processors
Future Work
References

Introduction

Though [XSLT] is principally oriented toward transformation of a single source document, it has built-in mechanisms for accessing multiple source documents. It is the purpose of TransQuery to reconcile and harmonize the single-source view with a multiple-source view, using existing standard constructs in XSLT 1.0.

In XSLT 1.0, multiple source documents can be accessed in two ways:

  1. using the document() function (see 12.1 Multiple Source Documents)

  2. passing a node-set in as the value of a top-level parameter (see 11.4 Top-level Variables and Parameters)

TransQuery defines a way to use the second of the above two mechanisms in an interoperable way.

TransQuery Input

This specification defines a namespace-qualified name, {http://www.xmlportfolio.com/transquery}input, for use as the name of a top-level parameter, the value of which must be a node-set consisting of zero or more root nodes. The set of root nodes is determined externally by the application. This convention facilitates the use of collection-oriented APIs (e.g. the [XML:DB API]), where the input available to a given query is determined outside of the query itself.

The following is an example use of the TransQuery input parameter:

<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>

Conformance

XSLT Stylesheets

While there are no TransQuery conformance requirements for XSLT stylesheets, it is considered bad practice to use names in the TransQuery namespace for purposes other than as described in this specification.

XSLT Processing Models

The term "processing model" is used here to denote the framework in which the XSLT processor itself lies. The processing model determines how the source tree is located, how parameters are passed to the stylesheet, what to do with the result tree, etc. TransQuery-conformant processing models must provide some mechanism outside of the stylesheet for binding a parameter with the TransQuery input name to a node-set consisting of zero or more root nodes. No other type may be bound to this parameter.

XSLT Processors

The XSLT recommendation states that "XSLT does not define the mechanism by which parameters are passed to the stylesheet."[XSLT] The only requirement for an XSLT processor to be used in a TransQuery application is that it provide a mechanism by which an XPath node-set can be supplied as the value of a top-level parameter.

Future Work

The following items are under consideration for future discussion and experimentation:

  • Using XSLT as a document update language

References

James Clark, editor. XSL Transformations Version 1.0. W3C (World Wide Web Consortium), 1999.

Ora Lassila, Ralph R. Swick, editors. Resource Description Framework (RDF) Model and Syntax Specification. W3C (World Wide Web Consortium), 1999.

Y. Goland, E. Whitehead, A. Faizi, S. Carter, D. Jensen. HTTP Extensions for Distributed Authoring -- WEBDAV.

XML:DB API Working Group, XML:DB Initiative. Application Programming Interface for XML Databases.