help concat 2 variables
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed Nov 11, 2009 6:04 pm
help concat 2 variables
Hi folks,
I need your help in the following scenario :
<xsl:variable name="var1" select="'SOME_DATA1'" />
<xsl:if test="'some_condition'">
<xsl:variable name="var2" >
<xsl:value-of select="'SOME_DATA2'"/>
</xsl:variable>
</xsl:if>
<data> <!-- I need here to contact var1 with var2, please help --> </data>
Thanks.
I need your help in the following scenario :
<xsl:variable name="var1" select="'SOME_DATA1'" />
<xsl:if test="'some_condition'">
<xsl:variable name="var2" >
<xsl:value-of select="'SOME_DATA2'"/>
</xsl:variable>
</xsl:if>
<data> <!-- I need here to contact var1 with var2, please help --> </data>
Thanks.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: help concat 2 variables
Using something like:
does not make too much sense because the variable will not be available outside the xsl:if instruction. The way to work in such situations is to place the xsl:if inside the variable definition, like<xsl:if test="'some_condition'">
<xsl:variable name="var2" >
<xsl:value-of select="'SOME_DATA2'"/>
</xsl:variable>
</xsl:if>
Code: Select all
<xsl:variable name="var2" >
<xsl:if test="'some_condition'">
<xsl:value-of select="'SOME_DATA2'"/>
</xsl:if>
</xsl:variable>
[code]
Best Regards,
George
George Cristian Bina
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