RE: how to change xsl dynamically?

Subject: RE: how to change xsl dynamically?
From: "Tom Gaven" <tgaven@xxxxxxxxx>
Date: Fri, 10 Sep 1999 12:38:41 -0400
Another way might be to create 2 (small) additional xml files..
myinfo1.xml  - ( uses filter1.xsl and has an external entity ref for
myinfo.xml)
myinfo2.xml  - ( uses filter2.xsl and has an external entity ref for
myinfo.xml)

(myinfo.xml would NOT have an associated stylesheet )

The client would then point the browser toward myinfo1.xml or myinfo2.xml,
but NOT myinfo.xml

Also, you may want to check out the Cocoon project.  Cocoon is a prebuilt
Java servlet
that matches (based on client agent?) a stylesheet with an xml document.
http://java.apache.org/cocoon/index.html
I think the way Cocoon works is an individual xml document has multiple
stylesheet headers,
and depending on the client agent ( netscape/ie ), the Cocoon servlet will
process a
particular xsl file with the xml document.

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of
> Marco.Mistroni@xxxxxxxxx
> Sent: Friday, September 10, 1999 10:28 AM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: RE: how to change xsl dynamically?
>
>
> Hi,
> 	sorry for not understanding, but if you want to choose which xsl
> file to use to process your xml file i think(it is my opinion)
> that you have
> 2 solutions:
> - modify the xml file manually
> - call an xsl processor and set the xsl file as parameter
> best regards
> 	marco
>
> > -----Original Message-----
> > From: EXT Sam.Walker [mailto:Sam.Walker@xxxxxxxxxxxxxx]
> > Sent: 10. September 1999 16:06
> > To: 'xsl-list@xxxxxxxxxxxxxxxx'
> > Subject: RE: how to change xsl dynamically?
> >
> >
> > I can't speak for Michele, but the solution I am looking for does not
> > involve an http server.
> > example
> > If I had three files on my machine myinfo.xml, filter1.xsl,
> > filter2.xsl. I
> > want to use my web browser to view myinfo.xml using filter1.xsl or
> > filter2.xsl. I have not identified a way to achieve this without
> > (a) modifiying myinfo.xml or
> > (b) using a http server with a server side script/application.
> > I guess that my problem is that the style sheet is specified
> > in the header
> > of the xml document, and this means that without modifying
> > the xml file
> > there is only one view of the information.
> > Is there a way or technique which allows you to specify in a seperate
> > document - 'use this xml document and render it with this
> > style sheet'?
> > eg forgive the syntax - myinfo_filter1.xml
> > <xml:include select='test3.xml'>
> > <xsl:include select="filter1.xsl>
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Marco.Mistroni@xxxxxxxxx [mailto:Marco.Mistroni@xxxxxxxxx]
> > Sent: 10 September 1999 09:33
> > To: xsl-list@xxxxxxxxxxxxxxxx
> > Subject: RE: how to change xsl dynamically?
> >
> >
> > hi,
> > 	maybe i do not understand fully the question, but if
> > 	the problem is to change xsl dynamically you could
> > try to do like this:
> > you write a common stylesheet in which you import another stylesheet
> > the  name of this stylesheet is a param-variable, so that you
> > can change it
> > from
> > for example a servlet.
> > when you call for example the servlet, based on a value
> > entered by the user
> > you use
> > the instruction setStylesheetParam() to set the name of the
> > xsl stylesheet.
> > Have i understood the problem correctly?
> > best regards
> > 			marco
> >
> > > -----Original Message-----
> > > From: EXT Sam.Walker [mailto:Sam.Walker@xxxxxxxxxxxxxx]
> > > Sent: 10. September 1999 10:35
> > > To: xsl-list@xxxxxxxxxxxxxxxx
> > > Subject: RE: how to change xsl dynamically?
> > >
> > >
> > > I have been trying to do the same thing, but I haven't found
> > > a way of doing
> > > it other than by the use of server-side scripting which dynamically
> > > generates the XML document header.
> > > I think it seems a bit strange to have a fixed style sheet in an XML
> > > document - how does this utilise the power of XML i.e. how
> > > can you display
> > > different views of an XML document other than by writing server side
> > > applications or by modifying the XML header by hand? Is
> > > anyone aware of a
> > > technique for this? Ideally you should not have to use an
> > > http server to
> > > achieve this.
> > >
> > > --New Naive Idealistic XML User (or just Sam).
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Michele Lee [mailto:mclee@xxxxxxxxx]
> > > Sent: 08 September 1999 22:16
> > > To: xsl-list@xxxxxxxxxxxxxxxx; Michele Lee
> > > Subject: how to change xsl dynamically?
> > >
> > >
> > >
> > > Hi,
> > >
> > > I'm trying to call a different stylesheet (with the same xml
> > > document) based
> > > on a button click.  I know that Microsoft website has
> > > examples of this, but
> > > they seem to be Microsoft specific methods.  Is there a
> > > generic way for
> > > changing XSL dynamically?  In particular, I'm looking for
> > > something that
> > > will
> > > work with both IE 5 and Netscape 5 (when it comes out).
> > >
> > > thanks!
> > >
> > > --Michele
> > >
> > >
> > >  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
>
>
>  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