You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Herring <da...@micromuse.com> on 2000/03/02 17:05:32 UTC

Applying different stylesheets


Hi,

Can I apply different stylesheets to the same XML content based upon
which URL they
select. I.E the same content being displayed in different manners ?

I realise you can have separate stylesheets for different media types of
access - so can you
use simular functionality to have different URL's access the same XML
data but apply their
own stylesheet.

thx dave




Re: Applying different stylesheets

Posted by Daniel Schneider <Da...@tecfa.unige.ch>.
Mike Engelhart wrote:
> 
> David Herring wrote:
> > As workaround until sitemaps become available you can link to the file
> > from another directory, and have relative paths for the stylesheet to pick
> > up a local copy in each of the directories.
> >
> > Thanks,  dave
> Duh - yeah, I forgot about that.  I even use that trick myself :-)
> 

I use a solution that needs more typing :(

-------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="results.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<!DOCTYPE include [
 <!ENTITY xmlFile SYSTEM "proj12.xml">
]>

<include>
&xmlFile;
</include>
----------

In an other file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="all.xsl" type="text/xsl"?>
                       -------
....

The only advantage of this is that you keep XML data in "neutral"
format. Oh I also decided to use *.sxml for files handled by
Cocoon. *.xml files are left alone.
- Daniel

PS: I think it's a funny problem. For me the ability to have different
views of the same XML file (e.g. in business 
one for marketing / support / users, in education one for all / abstract
/ ) was the FIRST thing that came to my mind when I first saw XSL.
Cocoon developers did not see that, proof that XML is a wide thing :)

-- 
Dr Daniel K.Schneider, TECFA (Educational Technologies and Learning)
Faculte de Psychologie et des Sciences de l'Education, University of Geneva,
email: Daniel.Schneider@tecfa.unige.ch
www:   http://tecfa.unige.ch/tecfa-people/schneider.html
MOO:   tecfamoo.unige.ch 7777

TECFA - FPSE - Université de Genève
40, Bd. du Pont d'Arve, 1205 Genève
Tel: 41 22 705 9377 - Fax: 41 22 705 9379 - Office#: 6359

Re: Applying different stylesheets

Posted by Mike Engelhart <me...@earthtrip.com>.
David Herring wrote:

> 
> 
> Mike,
> 
> Thanks.
> 
> As workaround until sitemaps become available you can link to the file
> from another directory, and have relative paths for the stylesheet to pick
> up a local copy in each of the directories.
> 
> Thanks,  dave
Duh - yeah, I forgot about that.  I even use that trick myself :-)

thanks for reminding me!

Mike


Re: Applying different stylesheets

Posted by David Herring <da...@micromuse.com>.

Mike,

Thanks.

As workaround until sitemaps become available you can link to the file
from another directory, and have relative paths for the stylesheet to pick
up a local copy in each of the directories.

Thanks,  dave

Mike Engelhart wrote:

> David Herring wrote:
>
> > Hi,
> >
> > Can I apply different stylesheets to the same XML content based upon
> > which URL they
> > select. I.E the same content being displayed in different manners ?
>
> > thx dave
> I think you have to wait for Cocoon v2 for this.  See the Cocoon 2 documents
> and look for "sitemap".
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Applying different stylesheets

Posted by Mike Engelhart <me...@earthtrip.com>.
David Herring wrote:

> Hi,
> 
> Can I apply different stylesheets to the same XML content based upon
> which URL they
> select. I.E the same content being displayed in different manners ?

> thx dave
I think you have to wait for Cocoon v2 for this.  See the Cocoon 2 documents
and look for "sitemap".

Mike