RE: Request clarification for XSLT 1.0: setting mode externally

"Michael Kay" <[email protected]>
Newsgroups gmane.org.w3c.xsl-editors
Message-ID <[email protected]>
I don't think the reference to 5.8 is relevant: you can invoke that code by
doing
 
<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: [email protected] [mailto:[email protected]] On
Behalf Of [email protected]
Sent: 30 March 2005 14:47
To: [email protected]
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')..
<quote>
The following shows the equivalent of the built-in template rule for mode m.

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

</quote>

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.