I want get template mapping using variable, I use for create vxml format for that XSl stylesheet how to it get blow xsl sheet
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:strip-space elements="*" />
<xsl:output method="xml" version="1.0" encoding="UTF-8" />
<xsl:template name="temp1" match="message">
<form>
<block>
<audio>
<xsl:attribute name="src1">
<xsl:value-of select="audio1/@src1" />
</xsl:attribute>
<xsl:value-of select="audio1" />
</audio>
</block>
</form>
</xsl:template>
<xsl:template name="temp2" match="message">
<form>
<block>
<audio>
<xsl:attribute name="src2">
<xsl:value-of select="audio2/@src2" />
</xsl:attribute>
<xsl:value-of select="audio2" />
</audio>
</block>
</form>
</xsl:template>
<xsl:template name="temp3" match="vxml">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd">
<xsl:call-template name="temp1" />
</vxml>
</xsl:template>
</xsl:stylesheet>
I want some time run tem1 and some time run tem2. you can use there variable(variable come in java ) change template how I develop the code? below code use for catch java value
<xsl:attribute name="src2">
<xsl:value-of select="audio2/@src2" />
</xsl:attribute>
<xsl:value-of select="audio2" />
This is the pass string from java
String var = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<vxml>"
+ "<audio src=\"" + getFullPath + "\"/>"
+ "</vxml>";
How I develop the code?
Thanks.