You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by vupt <vu...@yahoo.com> on 2000/03/07 03:27:13 UTC

dynamically specify a style-sheet?

HI,

Is there a way to dynamically specify a style-sheet?


I know that the following method to specify a
stylesheet works:
<xsl:processing-instruction
name="xml-stylesheet">href="page-html.xsl"
type="text/xsl"</xsl:processing-instruction>


What I am wondering is it possible to dynamically
choose the stylesheet from xml content 
instead of hard-coding it in like the above example.

IE. Instead of having href="page-html.xsl"
type="text/xsl" hard-coded,
can you something of the sort:

<xsl:processing-instruction name="xml-stylesheet">
<xsl:apply-templates
select="xslFile"/></xsl:processing-instruction>

where xslFile is data from an XML tag that has the xsl
file information needed by the processing instruction.
I tried but I couldn't get it to work. 

Does anyone know a method to dynamically select a
style-sheet? Depending on a user request, I would like
to have a style-sheet that is dynamically selected
from a pool of possible style-sheets.

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Re: dynamically specify a style-sheet?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 15 Mar 2000, Stefano Mazzocchi wrote:

> John Ky wrote:
> > 
> > Just guessing here:
> > 
> > <xsl:processing-instruction name="xml-stylesheet">
> >     <xsl:attribute name="href"><xsl:value-of
> > select="xslFile@href"/></xsl:attribute>
> >     <xsl:attribute name="type"><xsl:value-of
> > select="xslFile@type"/></xsl:attribute>
> > </xsl:processing-instruction>
> > 
> > Will this sort of thing work?

actually, should this just be

<xsl:processing-instruction
name="xml-stylesheet">href=&quot;whatever&quot;
type=&quot;otherthing&quot;</xsl:processing-instruction>

since the href and type "attributes" of the PI aren't really truly
attributes, but merely a convention?

- donald


Re: dynamically specify a style-sheet?

Posted by Stefano Mazzocchi <st...@apache.org>.
John Ky wrote:
> 
> Just guessing here:
> 
> <xsl:processing-instruction name="xml-stylesheet">
>     <xsl:attribute name="href"><xsl:value-of
> select="xslFile@href"/></xsl:attribute>
>     <xsl:attribute name="type"><xsl:value-of
> select="xslFile@type"/></xsl:attribute>
> </xsl:processing-instruction>
> 
> Will this sort of thing work?

yes


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: dynamically specify a style-sheet?

Posted by John Ky <ne...@yahoo.com>.
Just guessing here:

<xsl:processing-instruction name="xml-stylesheet">
    <xsl:attribute name="href"><xsl:value-of
select="xslFile@href"/></xsl:attribute>
    <xsl:attribute name="type"><xsl:value-of
select="xslFile@type"/></xsl:attribute>
</xsl:processing-instruction>

Will this sort of thing work?

John


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com