XSLT 2.0: Writing untyped stylesheets - how much is possible?

As the WG likely is well aware there is a lot of disquiet and concern in 
parts of the XSLT community about the typing requirements of XSLT 2.0.

I would like to use this email, which I suspect may become a long thread (but 
that could be useful since the issue is an important one), to explore the 
issue of how XSLT 2.0 will "look and feel" to a stylesheet author who wants 
to write untyped / loosely typed (a la XPath 1.0) stylesheets in XSLT 2.0.

Or to put the issue another way, is it possible for an XSLT stylesheet author 
to write XSLT 2.0 stylesheets (in their generality) without having to master 
(or at least become familiar with) W3C XML Schema types? How much can a 
datatype-agnostic stylesheet author make use of XSLT 2.0?

Before seeing the draft of 2nd May I was hopeful that there might be a clear 
path forward for such stylesheet authors to XSLT 2.0, but now I am less 
optimistic.

If there is a clear statement available in the various documents on how this 
issue pans out I would appreciate it if someone can point me to it (I haven't 
had time yet to read the new WDs in their entirety). A statement of that kind 
is certainly something that I would envisage as being usefully included in 
official documents, possibly in the context of a Primer document which I had 
suggested a few months back.

Am I correct in assuming, for example, that a type-unaware stylesheet author 
cannot use the date and time functions? I assume that when one of these 
functions meets a string which happens to be the lexical expression of a date 
that it will be typed as xdt:untypedAtomic and the processor will reject the 
argument to the function since it is not of the specified type for that 
function's argument. Is that correct? Or (less likely, it seems to me) will a 
date time function work on lexical representations in the absence of a 
schema?

If my assumption is correct, then many of the new XPath 2.0 functions will be 
unusable by stylesheet authors of the mindset mentioned earlier. Or, in other 
words, such stylesheet authors will be excluded from many benefits of XSLT 
2.0.

I guess that there is a de facto "loosely typed profile" for XSLT 2.0. Is it 
expressed anywhere? How narrow a subset is it? How practical or useful a 
subset is it?

Given that Data Model and Functions & Operators are now in Last Call, a 
clearly expressed description by the joint WG or the XSL WG would be very 
useful in my view. 

If the XSLT community is to express a sensible view on the issue mentioned 
the implications for the stylesheet author of the design decisions taken by 
the WG need to be spelled out clearly to the community. And, if an informed 
community viewpoint is to be expressed, then that summary should, in my view, 
be made available in good time to make comments on the Last Call WDs.

Assuming, but I am open to be corrected, that there cannot be a seamless 
loosely-typed usage of XSLT 2.0, the issue may become one of how best the WG 
communicates the principles of how successfully to make a transition to XSLT 
2.0. I would see an XSLT 2.0 Primer being of significant usefulness in that 
regard.

In summary I see two communication issues:

1. Communication to the existing XSLT community of which parts of XSLT 2.0 
will be usable without W3C XML Schema knowledge. Currently it isn't clear.

2. Communicating the *how* of making a successful transition from XSLT 1.0 to 
XSLT 2.0. A Primer-type document is needed to help bridge the knowledge gap.

Andrew Watt

Received on Wednesday, 7 May 2003 04:54:57 UTC