Reputation: 801
I have tried the following code :
<xsl:variable name="xx" select="'40967.6424503935'"/>
<script type="text/javascript">
time({$xx});
</script>
My intention is to display text via document.write() present in time(). But it didnt give any result.
Upvotes: 4
Views: 9213
Reputation: 21
<input type="hidden" id="title" select="{COL[@name='title']}"/>
<script type="text/javascript">
alert(document.getElementById('title').value);
</script>
This works for me.
Upvotes: 0
Reputation: 11
There should be a small correction in the above code snippet. The parameter should be passed within single inverted comma.
<xsl:variable name="xx" select="'40967.6424503935'"/>
<script type="text/javascript">
time('<xsl:value-of select="$xx" />');
</script>
This will work.
Upvotes: 1
Reputation: 70648
The curly braces are for 'Attribute Value Templates', but in this case you are not creating an attribute here, just a normal text node. I think you need to do something like this
<xsl:variable name="xx" select="'40967.6424503935'"/>
<script type="text/javascript">
time(<xsl:value-of select="$xx" />);
</script>
Upvotes: 6