As with the rest, it’s the little things that really get to you. If, like me,  you were struggling to get the correct syntax for javascript inside an XSL, here’s a little snippet that will work for you. It discloses the value of the current SitePublisher page to your javascript layer

<script type="text/javascript">
    <xsl:text disable-output-escaping="yes"><![CDATA[//<![CDATA[]]></xsl:text>
                   var iw_ls_page_name="<xsl:value-of select="/Properties/Data/External/Parameters/Datum[@Name='iw-ls-page-name']" />";
    <xsl:text disable-output-escaping="yes"><![CDATA[//]]]]></xsl:text>
    <xsl:text disable-output-escaping="yes">></xsl:text>

It may be that your javascript is in a js file. In that case, use the following sample syntax:

<script type="text/javascript"><xsl:attribute name="src">someScript.js</xsl:attribute><xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text></script>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s