EDN Admin
Well-known member
I need to generate around 50 elements on the target through XSLT and a around 10 extra based on some when conditions. Now the 50 elements would get repeated for every occurence of those set of 10 elements. I would like to minimize the amount of code by
calling templates. Can someone give a short snippet of how to do that. Assuming I am some 50 + 10 variables defined and having pre-poulated values.<br/>
I am looking at something like:
<xsl:template name="Listof50fields <br/>
< field1>$var1</field1><br/>
:<br/>
:<br/>
< field50>$var50</field50>
<xsl:template name="ConsolidatedRecord <br/>
< xsl:if $condition = 1>
<<---Call template Listof50fields --><br/>
<<Create the rest 10 fields>>
<field51>$var51 </field51><br/>
:<br/>
:<br/>
< field60>$var60 </field60>
</xsl:template>
View the full article
calling templates. Can someone give a short snippet of how to do that. Assuming I am some 50 + 10 variables defined and having pre-poulated values.<br/>
I am looking at something like:
<xsl:template name="Listof50fields <br/>
< field1>$var1</field1><br/>
:<br/>
:<br/>
< field50>$var50</field50>
<xsl:template name="ConsolidatedRecord <br/>
< xsl:if $condition = 1>
<<---Call template Listof50fields --><br/>
<<Create the rest 10 fields>>
<field51>$var51 </field51><br/>
:<br/>
:<br/>
< field60>$var60 </field60>
</xsl:template>
View the full article