The way I do:
<xsl:template name="addJavascript">
<script type="text/javascript">
<xsl:text>
var theme_path = '</xsl:text><xsl:value-of
select="$theme-path"/><xsl:text>',
login_message =
'</xsl:text><i18n:text>xmlui.pirhua.login.message</i18n:text><xsl:text>',
contact_message =
'</xsl:text><i18n:text>xmlui.pirhua.contact.message</i18n:text><xsl:text>';
</xsl:text>
</script>
</xsl:template>
You can replace XSLT tags the way you want.
Javier Távara
2013/9/1 bcoballes <[email protected]>
> Hi everyone,
>
> I would like to pass the URL <xsl:value-of
> select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/> of the bitstream to
> external javascript as variable. But when I declare it using this syntax:
>
> var x = '<xsl:value-of select="mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>';
>
> I received an javascript error 'Syntax error unexpected identifier'. How
> can
> I pass the value of the xsl:value-of select as javascript variable without
> error.
>
> Any input is greatly appreciated,
> Brian
>
>
>
> -----
> Librarian In-Charge of Non-Print
> Educational Media Center
> Ateneo de Manila High School
> Philippines
> --
> View this message in context:
> http://dspace.2283337.n4.nabble.com/passing-variable-to-javascript-tp4666961.html
> Sent from the DSpace - Tech mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette