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

RE: Selecting between multiple stylesheets on same xml

Subject: RE: Selecting between multiple stylesheets on same xml file (apache/cocoon)
From: Dave_White@xxxxxxxxxxx
Date: Wed, 5 Sep 2001 15:14:08 -0400
multiple xsl to same xml
Hi,

I haven't used cocoon, but I have used Xalan to perfrom an XSLT transform.
I was able to specify a stylehseet when creating an instance of class
javax.xml.transform.TransformerFactory. I used the constructor that takes a
stream source created from the XSL stylesheet.

This allows the XML source to have any number of transformations applied to
it, and they cn be determined at run time.

Again, I haven't used cocoon, so you might end up having to get in there
and change some of the code fro your implementation...

Good luck,
dave




Doug.Hewko@xxxxxxxxxxxxxxx@l... on 09/05/2001 02:48:47 PM

Please respond to xsl-list@xxxxxxxxxxxxxxxxxxxxxx

Sent by:  owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To:   xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc:   mjm1project@xxxxxxxxxxx
Subject:  RE:  Selecting between multiple stylesheets on same xml file
       (apache/cocoon)


Just a question, can you use JS or ASP, or some other server-side language
to generate the XSL for you? That definitely should allow you to accomplish
what you want. JS is supported by Tomcat.

I am quite sure that you can not have the XSL loaded dynamically as you
desire, but then I'm not really an expert. (Learning and trying.)

Just a thought...

> -----Original Message-----
> From: M M [mailto:mjm1project@xxxxxxxxxxx]
> Sent: September 5, 2001 2:43 PM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Selecting between multiple stylesheets on same xml file
> (apache/cocoon)
>
>
> Hi... first I want to say thanx to those who solved my
> xsl variable problem. Now I'm asking if there's a
> similar way to declare and pass an external value to a
> variable in the XML document itself.
> I'm using an apache/cocoon setup, with an xml newsfeed
> of about 5/6 categories of stories. With perhaps with
> php script, I want to detect the user's platform, eg
> normal desktop/laptop, PocketPC, Palm, etc using
> HTTP_USER_AGENT, also category(s) of user's news
> preferences, particular story etc, then select the
> appropriate xsl stylesheet to serve up content
> particular to their needs.
> At the moment, i'm using several copies of the same
> xml file referencing different stylesheets, and
> obviously this is ridiculous! What I want to do is
> something like this:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <?xml-stylesheet href="$xyz.xsl" type="text/xsl"?>
> <?cocoon-process type="xslt"?>
>
> where $xyz is a variable which can be declared in the
> xml file some way similar to the way I'm using
> <xsl:param> to construct variables in the xsl that can
> pick up values passed by a php script or appended to a
> url e.g http://myserver.com/news.xml?xyz=stylesheet1
>
> Thanks!
>
> P.S. Am I approaching this wrong? Should there be just
> one stylesheet reference in the xml, and then in the
> stylesheet itself use variables to select between
> diffent @import locations and have all the specific
> templates in small external xsl files?
>
>
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





 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.