Re: [xsl] Client-side XSLT processing by browsers

Subject: Re: [xsl] Client-side XSLT processing by browsers
From: "Ragulf Pickaxe" <ragulf.pickaxe@xxxxxxxxx>
Date: Sun, 27 Aug 2006 16:19:33 +0200
Hi JJ,

Passing parameters in the querystring is an HTML construct, not an XSL
one. Also, there are 4 different types in XSL (string, boolean, number
and nodeset), how would you differentiate between these in a
querystring-based manner? Remember that the type must be declared
before passing to the XSL stylesheet.

I think, to achieve somewhat what you want, you will have to make an
html page that accepts querystring parameters and then uses javaScript
to pass these into the desired XSL document and doing the
transformation, using itself as the input document, if you desire

I know that this is not what you had hoped for, but I hope my answer
is of some small help anyway.

Ragulf Pickaxe :-)

On 8/27/06, JJ Merelo <jjmerelo@xxxxxxxxx> wrote:
I have been looking for info on using the XSLT processors in browsers,
namely Firefox and Opera. They seem to work well (although, if you use them
on the client side, Firefox requires the extension .xhtml to apply xslt
properly), but the problem I have found is that the only way to pass
parameters to the XSLT stylesheet is using it via Javascript.
What I want to do is something like this: process a file locally using
filename.xhtml?param1=value1;param2=value2 and so on
with filename.xhtml having:
<?xml-stylesheet href="stylesheet.xsl" type="text/xsl"?>
and, in stylesheet.xsl
<xsl:param name='param1'>
on the XSLT stylesheet. I have tested in in Firefox and Opera, and it does
not seem to pick up the parameters. Is there any other way of passing params
to that stylesheet? Or at least, a way that works?
What I want to do is to present different content depeding on the way it's
called. For instance, calling filename.xhtml?mode=index would just return
the <h2> tags and so on.

Thanks for any answer!

Current Thread