[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: XSLT 3.0: The definition of the "unnamed mode"


Subject: [xsl] Re: XSLT 3.0: The definition of the "unnamed mode"
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Jan 2015 22:27:24 -0000

> I agree, this definition is not a very good one. It's a relic of when the
unnamed mode was always the default mode. A better definition might be:
>
> "There is a mode, called the unnamed mode, that has no name. The properties
of the unnamed mode may be defined using an xsl:mode declaration with an
absent name attribute. The unnamed mode is the default mode for an
xsl:apply-templates or xsl:template element with no mode attribute, unless a
different mode is nominated as the default using an [xsl:]default-mode
attribute."

Yes, this is precise.

Cheers,
Dimitre Novatchev


>
> Michael Kay
> Saxonica
> mike@xxxxxxxxxxxx
> +44 (0) 118 946 5893
>
>
>
>
> On 27 Dec 2014, at 19:04, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
>
>> In the 2nd Last Call of the W3C XSLT 3.0 specification, section "6.6.1
>> Declaring Modes" defines "unnamed mode" thus:
>>
>> "[Definition: The unnamed mode is the default mode used when no mode
>> attribute is specified on an xsl:apply-templates instruction or
>> xsl:template declaration, unless a different default mode has been
>> specified using the [xsl:]default-mode attribute of a containing
>> element.]"
>>
>> I find this definition rather confusing, because the undefined term
>> "default mode" is used and because this term seems undistinguishable
>> from two other terms used in the definition: "different default mode"
>> and "[xsl:]default-mode attribute".
>>
>>
>>
>> To summarize, this definition seems (endless) recursive, having not
>> specified the term "default mode" on which it is based.
>>
>>
>> I believe that a definition that more precisely defines the "unnamed
>> mode" could be something like this:
>>
>> 1. A mode defined in an xsl:mode declaration (the one with highest
>> import precedence) that has no "name" attribute specified, or
>>
>> 2. If there is no xsl:mode without a "name" attribute, then a mode
>> that is defined by an (implicit) xsl:mode declaration without any
>> attributes.
>>
>> 3. The unnamed mode defined in 1. and 2. above is used as the value of
>> the "mode" attribute of any "xsl:template" or "xsl:apply-templates"
>> that have no "mode" attribute specified, unless these are in the scope
>> of an "[xsl:]default-mode" attribute, in which case the mode specified
>> in the (innermost) "[xsl:]default-mode" attribute is used as the value
>> for their "mode" attribute.
>>
>>
>> Any thoughts, please?
>>
>>
>>
>> --
>> Cheers,
>> Dimitre Novatchev
>



--
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
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.


Current Thread
Keywords