Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
paths in xsl cjcj1
Just to play around I also hardcoded the path in the Js file but the only way I could access the image was by something like this ../image and not with an absolute path like c:/output/image or c:\output\image
There are many possible ways to do this. here's one:
In your XSL, you can create a <script> element and define a global variable in it.
[the following goes in your XSL, preferably inside the <head> or early in the <body>]
<xsl:text>window.myvariable = '</xsl:text> <xsl:value-of select="xpath-to-your-image-name" /> <xsl:text>';</xsl:text> </script>
Another way would be to create an XML "Island" in the DOM, and parse data out of that
I'd go for the first method; it's easiest.
Good luck cjcj1!
In the example above, your value is stored in a variable called "window.myvariable". Since "window" is the default root global scope, you can just use "myvariable", like this:
alert(myvariable); </script> cjcj1