W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2005

RE: Request clarification for XSLT 1.0: setting mode externally

From: Michael Kay <mhk@mhk.me.uk>
Date: Wed, 30 Mar 2005 15:42:12 +0100
To: <david_marston@us.ibm.com>, <xsl-editors@w3.org>
Message-ID: <E1DGeOk-0003nx-EL@frink.w3.org>
I don't think the reference to 5.8 is relevant: you can invoke that code by
<xsl:apply-templates select="document('a.xml')" mode="m"/>
XSLT 1.0, as you say, is silent as to whether you can start a transformation
in a mode other than the default mode. That, to my mind, means that
implementations may provide the capability but are not required to do so.
Make your own decision.
MSXML3 has always provided this capability, I believe.
A rather more important capability, where the spec is also silent, is the
ability to start the transformation at a node other than the root.
I shouldn't expect any revisions to the spec in this area. It wouldn't serve
any useful purpose in terms of interoperability: many of the popular XSLT
1.0 processors are now effectively frozen.
Michael Kay (personal view)


From: xsl-editors-request@w3.org [mailto:xsl-editors-request@w3.org] On
Behalf Of david_marston@us.ibm.com
Sent: 30 March 2005 14:47
To: xsl-editors@w3.org
Subject: Request clarification for XSLT 1.0: setting mode externally

The Apache Xalan Project has just received an enhancement request from Mukul
Gandhi that our XSLT 1.0 processor allow setting of the mode before
transformation begins. Of course, Section 5.7 of the 1.0 spec is silent on
this point, being only two paragraphs. However, the report cites an
interesting part of 5.8: 

"The XSLT 1.0 spec explicitly says (section '5.8 Built-in Template Rules')..
The following shows the equivalent of the built-in template rule for mode m.

<xsl:template match="*|/" mode="m">
 <xsl:apply-templates mode="m"/>


This gives impression that the template rule for root node in an initial
mode exists. So the XSLT processor should provide an option to pass initial
mode to the transformation.

But I cannot find anywhere in spec that this is a mandatory requirement(i.e.
passing initial mode). So I have not called this a bug, but as a
'improvement request'."

Even if such a capability is an optional feature, Section 5.7 should
acknowledge the possibility. In so doing, I hope you would make it resemble
the 2.0 capability as much as possible. Also, you would want to address
whether and how the mode name could be a namespace-qualified name. 
.................David Marston 
Received on Wednesday, 30 March 2005 14:42:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:24 UTC