xsl-list
[Top] [All Lists]

Re: [xsl] Default actions in XSLT 2.1

2008-10-31 19:43:24
The idea is to make modes (the things named in the mode attribute of
xsl:template and xsl:apply-templates) first class objects that can have
properties; the properties would be declared as attributes of an xsl:mode
declaration; one of the properties is the choice of default template rules
for the mode. An xsl:mode declaration with no name attribute declares the
properties of the unnamed ("default") mode, just as an xsl:decimal-format
declaration with no name defines properties of the default decimal-format.


Sounds nice.

Going further, I'd propose that the *default value* for the
"default-action" attribute of the unnamed <xsl:mode> be
   "xslmode:clone"
if the "version" attribute of the <xsl:stylesheet>    is    >=   2

and
  "xslmode:copy-text"  (the current processing behaviour for version 1.0)
otherwise.


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play



On Fri, Oct 31, 2008 at 4:10 PM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:
I would propose:

  <xsl:mode default-action="clone"/>

I would suggest to consider the verb:

  <xsl:process/>
or

  <xsl:processing-mode/>

instead of <xsl:mode/>

as we already have a "mode" attribute with slightly different
scope (template selection).

The idea is to make modes (the things named in the mode attribute of
xsl:template and xsl:apply-templates) first class objects that can have
properties; the properties would be declared as attributes of an xsl:mode
declaration; one of the properties is the choice of default template rules
for the mode. An xsl:mode declaration with no name attribute declares the
properties of the unnamed ("default") mode, just as an xsl:decimal-format
declaration with no name defines properties of the default decimal-format.

No doubt the choice of keywords will continue to provide entertainment for
some while; I tend to the view that when you hear people arguing the
spelling of the keywords, it's like when a sales prospect starts arguing
about the price; you can smell victory.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>