Re: comment on 'mode' and also Re: Processing modes

Subject: Re: comment on 'mode' and also Re: Processing modes
From: Lars Marius Garshol <larsga@xxxxxxxxxx>
Date: 15 Apr 1999 12:15:39 +0200
* Alistair MacDonald
| 
| That should be 'mode', not 'modes'. 

That's correct. Sorry, that was a typo in my email and not in the XSL
stylesheet.

| The match sequence will be a template that HAS the required 'mode'
| and, if that fails a template with NO mode. 

Rereading the spec I see that you're right. There is a sentence that
appears to contradict what you say, but it is modified in the
paragraph below. (2.7.8, second and third paragraphs.)

| *HOWEVER* 'mode's are NOT sticky, so given this:

I already knew that and although there is an intermediate element
between the apply with mode and the handled element, inserting a
mode template for the intermediate element that passes on the mode
does not affect the output.

I've tried that before and I tried it again now, but still with no
result.
 
So, I'm still no closer to a solution to this, although the LotusXSL
people have now responded to my bug report and so I may be able to
check with LotusXSL soon. As soon as I can find the time I'll try to
work this out with 4XSL too.

Thanks for the attempt to help, anyway.

| There is no reason why 'mode' should not be sticky, since it could
| easily be cancelled ('mode=""') and, if no mode is matched it
| defaults to the empty mode.

I've been thinking the same thing myself. And I'm not sure I like it
that mode="by-number" will match non-modal templates if there is no
by-number template. That will lead to fragile stylesheets that fail
whenever an intermediate element that nobody considered appears.

Why not have an optional modes attribute of type NMTOKENS that lists
the modes to which a template applies? -NO-MODE could signify the
empty mode (- is not a name start character, but is a name character).

BTW: I think # should have been a name character (not name start, but
a name character), so that the # prefix could have been used in
NMTOKENs that need to have non-NAME values. 

--Lars M.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread