This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Cascading with <?xml-stylesheet?>
- To: xsl-list at mulberrytech dot com
- Subject: Re: Cascading with <?xml-stylesheet?>
- From: Matt Sergeant <matt at sergeant dot org>
- Date: Mon, 24 Apr 2000 11:20:23 +0100 (BST)
- Reply-To: xsl-list at mulberrytech dot com
On Sun, 23 Apr 2000, Matt Sergeant wrote:
> Hate to reply to myself... It appears that it does make sense: Cascading
> is supported where the language supports cascading: i.e. in CSS, but not
> in XSL(T). Thanks for listening to me rambling ;-)
Actually there's more to this...
In the case of cascading it's a simple choice: You apply the persistent
stylesheets, and then if the user has picked a "title" you apply the
alternate stylesheets, otherwise you apply the preferred stylesheets.
But what about the case of non-cascading systems? In that case, is it an
error to have more than one matching stylesheet? The specs seem quite
vague in this respect. Take for example the following:
<!-- persistant stylesheet -->
<?xml-stylesheet href="blah.css" type="text/css"?>
<!-- also persistant, but different type -->
<?xml-stylesheet href="blah.xsl" type="text/xsl"?>
<!-- preferred -->
<?xml-stylesheet href="blah2.xsl" type="text/xsl" title="pref"?>
<?xml-stylesheet href="blah2.css" type="text/css" title="prefalso"?>
<!-- alternate -->
<?xml-stylesheet href="blah3.xsl" type="text/xsl"
title="alt1" alternate="yes"?>
<?xml-stylesheet href="blah3.css" type="text/css"
title="alt2" alternate="yes"?>
<!-- is this an error? -->
<?xml-stylesheet alternate="yes" href="blah4.css" type="text/css"?>
In a non-cascading system, I would have thought the server _had_ to pick
the persistant stylesheet _only_. But what if the user has selected a
title? Here's the scheme I came up with, but there's no documentation
about how to do this - the specs _need_ improving! I came up with a
scoring system:
Score | Media Matches | Title Exists | Title Matches | Alternate
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0 no no - no
3 yes no - no
5 no yes irrelevant? no
8 no yes yes yes
10 yes yes irrelevant? no
15 yes yes yes yes
-5 (err?) yes no - yes
-10 (err?) no no - yes
And the highest score wins. I personally don't think this is right - but
it's a first stab at it - and I think the specs need to be clearer on this
(have I said that enough yet?). I'm not even sure if a matching title
should be relevant on the preferred stylesheets - someone please tell me!
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list