RE: [xsl] Using Javascript with XSLT

Subject: RE: [xsl] Using Javascript with XSLT
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 15 Apr 2009 00:09:58 +0100
Yes, when your Javascript code initiates a transformation, then it can pass
a parameter to the transformation, using a method such as addParameter() or
setParameter() (different products have different APIs). The parameter is
declared in the stylesheet using xsl:param.

However, the mistake people sometimes make here is to think that a single
transformation can both generate Javascript code and be affected by the
execution of that code. Remember the sequence of events: XSLT generates
HTML, the HTML is executed by the browser, execution of script in the HTML
can initiate another (separate) transformation, that second transformation
can generate more HTML, which in turn can be executed by the browser.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Robert G [mailto:nyjets3422@xxxxxxxxx] 
> Sent: 15 April 2009 00:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Using Javascript with XSLT
> 
> 
> Hi,
>      Is there anyway that I can use javascript to pass a 
> variable to XSLT? I am trying to use a button to get the next 
> page, but if their are no numbers in the XML for the XSLT to 
> grab, then I am having trouble getting the javascript to 
> allow the XSLT code to know which page is up and which page 
> is next etc. Is it possible to use javascript to put the page 
> number into the xslt? Thanks.

Current Thread