You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Benoit Fouche <b....@cross-systems.com> on 2000/03/29 17:49:47 UTC

multiple XSL stylesheet in XML ?

Hi !
Can I multiple <?xml-stylesheet href="test.xsl" type="text/xsl"?> declaration in a XML document ?
And How, and what are the fields that determine what stylesheet to use ?
Thanks.

Re: multiple XSL stylesheet in XML ?

Posted by Benoit Fouche <b....@cross-systems.com>.
Thanks !


Re: multiple XSL stylesheet in XML ?

Posted by Dan Morrison <dm...@es.co.nz>.
Elaine Brennan wrote:
> 
> At 05:49 PM 3/29/00 (+0200), Benoit Fouche wrote:
> >Hi !
> >Can I multiple <?xml-stylesheet href="test.xsl" type="text/xsl"?>
> >declaration in a XML document ?
...
> You can also use the "media" pseudo-attribute to specify that a particular
> stylesheet is meant for use with a particular presentation medium: paper,
> hand-held, etc.
...

I didn't investigate this fully, but I found that declaring multiple
stylesheets and NOT declaring different media types crashed Cocoon.

This might have been a side effect from other development I was doing at
the time, but I added media types and the problem went away.

.dan.

Re: multiple XSL stylesheet in XML ?

Posted by Elaine Brennan <el...@worldnet.att.net>.
At 05:49 PM 3/29/00 (+0200), Benoit Fouche wrote:
>Hi !
>Can I multiple <?xml-stylesheet href="test.xsl" type="text/xsl"?> 
>declaration in a XML document ?
>And How, and what are the fields that determine what stylesheet to use ?

Yes, you can.  You do so using two of the pseudo-attributes available on 
the xml-stylesheet processing instruction: "title" and "alternate":

<?xml-stylesheet alternate="yes" title="compact" href="small-base.css"
type="text/css"?>
<?xml-stylesheet alternate="yes" title="compact" href="small-extras.css"
type="text/css"?>
<?xml-stylesheet alternate="yes" title="big print" href="bigprint.css"
type="text/css"?>
<?xml-stylesheet href="common.css" type="text/css"?>

You can also use the "media" pseudo-attribute to specify that a particular 
stylesheet is meant for use with a particular presentation medium: paper, 
hand-held, etc.

Browsers and other tools ("user-agents") are supposed to allow the end-user 
to select which stylesheet to use when multiple stylesheets are associated 
with a particular document.

--ELaine






----

Elaine M. Brennan
Principal XML Technologist
Inferdata Corporation
elaine@inferdata.com
512/306-8225