ronron5477
03-25-2010, 03:03 PM
Ok, so I have an XSL and i would like to the Javascript with in it.
I have something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xalan="http://xml.apache.org/xslt">
<xsl:output method="html"/>
<xsl:template >
<script language="javascript" grp="xsljs">
myarr[myarr.length]="1234";alert("hey there");
</script>
</xsl:template>
</xsl:stylesheet>
The Javascript won't run once it prepares the html code.
I have to do a document.getElementsByTagName("script") once the xsl has ran, find the scripts with the tag "grp" equal to the "xsljs", then run an eval on the script's innerHTML to kick it off.
Is there any other way to do this? Is there any way to run the javascript in the XSL?
I have something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xalan="http://xml.apache.org/xslt">
<xsl:output method="html"/>
<xsl:template >
<script language="javascript" grp="xsljs">
myarr[myarr.length]="1234";alert("hey there");
</script>
</xsl:template>
</xsl:stylesheet>
The Javascript won't run once it prepares the html code.
I have to do a document.getElementsByTagName("script") once the xsl has ran, find the scripts with the tag "grp" equal to the "xsljs", then run an eval on the script's innerHTML to kick it off.
Is there any other way to do this? Is there any way to run the javascript in the XSL?