[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Cascading with <?xml-stylesheet?>

Subject: Re: Cascading with <?xml-stylesheet?>
From: Matt Sergeant <matt@xxxxxxxxxxxx>
Date: Mon, 24 Apr 2000 11:20:23 +0100 (BST)
xml stylesheet href xsl
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.