how to set a javascript variable in an xsl variable.
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 7
- Joined: Mon Nov 05, 2007 1:00 pm
- Location: India
how to set a javascript variable in an xsl variable.
Post by mebimathew »
Hi
can you please tell me how to set a javascript variable in an xsl variable.
i have done like this
<xsl:variable name="hello">
<script language="javascript">
var i =0;
</script>
<script language="javascript">
alert('<xsl:value-of select="$hello"/>');
</script>
</xsl:variable>
i know this wont work..can you please tell me how to set a javascript variable in an xsl variable.
Thanks in advance
can you please tell me how to set a javascript variable in an xsl variable.
i have done like this
<xsl:variable name="hello">
<script language="javascript">
var i =0;
</script>
<script language="javascript">
alert('<xsl:value-of select="$hello"/>');
</script>
</xsl:variable>
i know this wont work..can you please tell me how to set a javascript variable in an xsl variable.
Thanks in advance
Hi all
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Hi,
I am not exactly sure what you are trying to accomplish.
You are declaring a variable and in it you are trying to refer to the same variable.
This can't be right.
Is this something more like what you want?
If not, can you clarify more what you are trying to accomplish?
Regards,
Radu
I am not exactly sure what you are trying to accomplish.
You are declaring a variable and in it you are trying to refer to the same variable.
This can't be right.
Is this something more like what you want?
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xsl:variable name="hello" select="1"/>
<script language="javascript">
var i =<xsl:value-of select="$hello"/>;
</script>
<script language="javascript">
alert('<xsl:value-of select="$hello"/>');
</script>
</xsl:template>
</xsl:stylesheet>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service