XSLT & XBase

Subject: XSLT & XBase
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Tue, 23 May 2000 12:13:48 +0200
Analyzing the xml-uri debate[1], I think a clarification would be needed
about XBase[2] management by XSLT transformations.

A glance to the www-xml-linking-comments archives[3] doesn't show such a
clarification and I wonder if anyone has begun thinking about this

The xsl-list archives content some threads related to this subject :

* "Using xml:base in an xsl:stylesheet declaration - how about it?" [4]
  started by Dan Morrison this thread is about using XBase for
  xsl includes.
  Mike Kay derived from this question, though, by adding :
  > I think that if you generate the xsl tree by using XSLT, 
  > there is no way of setting its Base URI. The Base URI is 
  > defined for a result tree fragment,
  > but not for the final result tree.

* "relative and base URIs when using document() function" [5]
  and "Base URL for input to the document() function" [6]
  title says it ;) 

The issue which is currently only a matter of feature request may impact
the core XSLT if relative namespace URIs were to be used.

You can define 3 different XBases in a XSLT transformation :

1) the base for the nodes of the document tree.
2) the base for the nodes of the XSLT sheet as a document.
3) the base for the nodes of the eoutput tree.

Imagine a use case where you are using relative URIs with the following
bases :

    ./xml/  for the document
    ./xsl/  for the stylesheet
    ./doc/out/  for the output tree

Namespaces with relative URIs :

To map a namespace defined as xmlns:ns="foo" in the input document, you
would probably have to declare it as xmlns:ns="../xml/foo" in the
stylesheet (if I understand correctly the debate about "absolutization")
and the transformation would have to generate xmlns:ns="../../xml/foo"
in the output tree to keep a relative reference to the same namespace.

XBase processing as a feature request :

Independently of the namespace URIs, the example is showing that
processing XBase (together with associated standards such as XInclude
and XPointer) can be quite messy.

Has anyone thought of XSLT extensions to implement some features like :

 - setting a base URI for the output tree.
 - translating a relative ref based on the base for the input document 
   into a relative ref based based on the base for the output tree.
 - "absolutizing" a relative reference.
 - ...

It could probably make XBase transformations much easier.

Thanks for your thoughts about this.


[1] : http://lists.w3.org/Archives/Public/xml-uri/
[2] : http://www.w3.org/TR/xmlbase
[3] : http://lists.w3.org/Archives/Public/www-xml-linking-comments/
[4] : http://www.mulberrytech.com/xsl/xsl-list/archive/msg10379.html
[5] : http://www.mulberrytech.com/xsl/xsl-list/archive/msg10891.html
[6] : http://www.mulberrytech.com/xsl/xsl-list/archive/msg12319.html
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com

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

Current Thread