PDA

View Full Version : Calling all XSL pros


sethwb
08-31-2009, 10:33 PM
Whenever I try to add a second script tag in my XSL template it prevents the second one from being read by the browser...


<script type="text/javascript" src="">
<xsl:attribute name="src">js/jquery-1.3.2.min.js</xsl:attribute>
</script>
<script type="text/javascript">
RandomScriptHere
</script>


So anything in "RandomScriptHere" isn't functioning.

Please help!!!!!!!!!! :(

Mike_O
08-31-2009, 10:51 PM
Hey sethwb,

Are you wrapping your script with CDATA?

If no, try this: http://www.w3schools.com/xmL/xml_cdata.asp

Regards,
Mike

sethwb
09-01-2009, 03:52 AM
oh wow I just typed up a long reply and waited too long to post... love it when relogging in trashes my reply!

anyway..

basically yes I have tried that. the only thing that seems to work is to combine all js into one file, and to put in a dummy "script" element (and close it) so that that line doesnt end up bleeing over my stylesheet and breaking that instead.

Mike_O
09-01-2009, 04:41 PM
Hey sethwb,

I could be wrong, but I think what's happening is that it's trying to parse everything between the top-most opening "<script...>" and the bottom-most closing "</script>", know what I mean?

Try including your two separate JS files like this:

<script type="text/javascript" src="file1" />
<script type="text/javascript" src="file2" />

Mike

sethwb
09-02-2009, 03:33 PM
I think you are part right: the reason I say that is I was thinking the same thing. The only reason it doesn't make sense is it doesn't actually process any of the functions or variables (they return undefined).

I appreciate your input. The solution I went with (before I saw your last post) was to just add the dummy script tag in there after it for now since I plan to combine everything into an external file soon. If it comes down to it that will be the first thing I try