[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] JScript embedded in xsl


Subject: Re: [xsl] JScript embedded in xsl
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Tue, 20 Jan 2004 15:07:04 -0800

annirack@xxxxxxx wrote:

Hi,
I realise that this isn't entirely an xslt problem, but I'm not entirely familiar with the JScript API for MSXML which is part of the problem.

I want to add some JScript to the results (html) of an xslt so that when the user clicks a link on the result page, it causes an instance of MSXML to retransform the xml file (possibly taking parameters) and reload the browser window with the new results.

Client side transformation is the only appropriate way of handling this problem in this case. Server side transformation would work quite nicely, but this isn't in a situation where there's a server present.


Hi,


check out microsoft's site for examples, but:

Create a processor object:
// might want to cache this
var templates = new ActiveXObject("Msxml2.XSLTemplate.4.0");
templates.stylesheet = XSLT_as_A_DOM_object_variable;
var processor = templates.createProcessor();
...
processor.input = XML_DOM_source_variable;
processor.addParameter(name, value);
processor.transform;
document.all.containerDiv.innerHTML = processor.output;

best,
-Rob


Thanks,
Brendan


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
Keywords