Jump to content

Call a java Script file from XSL....


Guest nitin_sham

Recommended Posts

Guest nitin_sham

If i put a function in XSL that calls javascript file then what will be the code of that genric class that can call any javascript file through any function in XSL file..Thanx Nitin

Link to comment
Share on other sites

It depends. If the JavaScipt is stored inside an XML file, then the code would be something like:<script><xsl:value-of select="XPath expression to the script" /></script>Or if you want to call a JS file depending on a condition, you could use a conditional statemens:<xsl:variable name="script">URL to the script or a select statement inside the variable to point to a place in the XML file for the location</xsl:variable><xsl:if test="condition"><script src="{$script}"></script></xsl:if>I don't understand the question completely. What do you mean? Hm... do you mean if the JavaScript will manipulate the XHTML output or the XSLT file it's used in? If that's the case... I don't know actually. You should make some kind of test to see that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...