On 20 Nov 2003 06:50:54 -0800,
st***********@ams.com (steve) wrote:
All I want to do is
associate one xml file with multiple xsl stylesheets.
This is easy. Getting it to do something useful is harder !
You can "associate" multiple stylesheets by using multiple PI's (the
<?xml-stylesheet ... alternate="yes" ?> business)
http://www.w3.org/TR/xml-stylesheet/
Small problem with this is that you can indicate the default with
alternate="no" (or omitting it) but there's no mechanism to indicate
precedence or other bindings for alternates. The "media" attribute
might be adequate for you.
A larger problem is that this association does not _cause_ the
stylesheet to be processed. That's the task of the stylesheet
processor, which is an application-dependent task that's outside the
scope of the W3C standards.
If you're on your own web server, then it's pretty easy. parse the
PI's at the top, invoke the processor accordingly. Write your own
rules for selecting which one to choose, and just invoke the processor
accordingly.
On the client-side browser, then IE (and some others) now process XML
according to a default stylesheet (but watch out for a "default"
choice that's merely the first in the list, ignoring the alternate
attribute).
If you want alternates to be processed usefully on the client, then
you're into writing some JavaScript. You may find a "data island"
approach useful here, loading the page as static HTML with embedded
XML, then processing it and writing it into a <div>, rather than
processing the whole XML document into a single output page (which can
then be hard to retrieve the other PI's)
--
Die Gotterspammerung - Junkmail of the Gods