[Home] [By Thread] [By Date] [Recent Entries]
u have to wrap javascript with something like <script> <xsl:text disable-output-escaping="yes"><![CDATA[ <!-- some javascript here //--> ]]></xsl:text> </script> but if u want to recurse, generating some javascript with xsl, do something like below using <xsl:for-each>, there are better ways but this will get u started. xsl --------------------------------------------------------------------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <HTML> <script language="JavaScript1.1"> var photos=new Array() <xsl:for-each select="//product"> photos3[0]='<xsl:value-of select="@image1"/>' </xsl:for-each> </script>
,jim fuller Sandy Stasko wrote: i am trying to export javascript and html in my xsl. one thing i cannot get to work is exporting javascript functions that also make use of the xml nodes. for example, i want to be able to cache an array of images. i want to use the javascript features of New Array and New Image, but point the src of the image to a path in a node in my xml file. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



