How could I use xsl:call-template in an other xsl:call-template? I appreciate of
some one help in solving this problem.
I have two xsl files.
==== test.xsl ====
xsl:call-template name="utils.formField"
xsl:with-param name="titleName" select="'Select Title'"/
xsl:with-param name="titleFontFace" select="'Arial'"/
xsl:with-param name="titleFontSize" select="'+2'"/
xsl:with-param name="titleColor" select="'Maroon'"/
xsl:with-param name="name" select="'selectname'"/
xsl:with-param name="size" select="'1'"/
xsl:with-param name="fieldType" select="'select'"/
xsl:call-template name="utils.selectOption"
xsl:with-param name="value" select="'1'"/
xsl:with-param name="display" select="'test'"/
/xsl:call-template
/xsl:call-template
=== other.xsl ===
xsl:template name="utils.formField"
xsl:param name="titleName"/
xsl:param name="titleFontFace"/
xsl:param name="titleFontSize"/
xsl:param name="titleColor"/
xsl:param name="fieldType"/
xsl:param name="name"/
xsl:param name="size"/
font face="{$titleFontFace}" size="{$titleFontSize}" color="{$titleColor}"
xsl:value-of select="$titleName"/
/font
xsl:choose
xsl:when test="$fieldType='select'"
select
xsl:attribute name="name"
xsl:value-of select="$name"/
/xsl:attribute
xsl:attribute name="size"
xsl:value-of select="$size"/
/xsl:attribute
Here is my problem. I want to generate tag option value="1" test /option by calling utils.selectOption in test.xsl.Could some one help me?
/select
/xsl:when
/xsl:template
xsl:template name="utils.selectOption"
xsl:param name="value"/
xsl:param name="display"/
option
xsl:attribute name="value"
xsl:value-of select="$value"/
/xsl:attribute
xsl:if test="selected='yes'"
xsl:attribute name="selected"/
/xsl:if
xsl:value-of select="$display"/
/option
/xsl:template
test(4).xsl Test.xsl
other.xsl other.xsl
|