Yes, saucer(思归/MVP).But the page that I use xsl transform is a no refreshing page,so it is difficult to reload the window.onload event handle.I do all data exchange by xmlhttp,and I do not need to refresh the page.
Can you get a solution that execute the event handler automatically?
I think your sample code has illuminate everything that puzzle me some days.Thank you very much again.
By the way,may I ask you another question? Your sample code has soled the transform and evaluate problem indeed, but the javascript function still depend on the element event,and the evaluate statement only execute by custom event.So how can I make it executing immediately all javascript code of the transformer itself ?
function initialFun()
{
var xdoc=new ActiveXObject("msxml2.domdocument");
xdoc.async=false;
xdoc.load("TestSample.xml");
var doc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
doc.async=false;
doc.load("TestSample.xsl");
var xsltem=new ActiveXObject("Msxml2.XSLTemplate");
xsltem.stylesheet=doc;
var pro=xsltem.createProcessor();
pro.input=xdoc;
pro.transform();
<xsl:template match="/">
<html>
<head>
<script language="javascript">
var val;
var n = 1;
function transform()
{
var xmldom = document.XMLDocument;
var xsldom = document.XSLDocument;
var xmlnode = xmldom.documentElement;
var xslnode = xsldom.selectSingleNode("//xsl:param[@name='n']");
n++;
xslnode.setAttribute("select",n);
Thanks for saucer(思归/MVP),and thanks for your commendatory site.I think you are right.The value saved in the global variable may be evaluated again or lost its original value.
But,what I want to resolve is that how can I get a value from the xsl transforming process,why I refer to the <msxsl:script> element is I want to use the javascript in xsl to interact with the javascript in HTML.I need a dynamic data exchange.Now the xsltemplate only give me the <xsl:param> to input values,but it can not give me a way to output values as dynamically interact usage,which just like a javascript variable.