|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Repetition without a repeated source node
James Kerr wrote:
> I have an XML document that has a number as one of its attributes. I
> would like to use that number as input into a loop and output
> a block of HTML code the specified number of times.
In one template, do this...
<xsl:call-template name="MakeHTMLBlock">
<xsl:with-param name="num" select="number(@foo)"/>
</xsl:call-template>
And then have this template...
<xsl:template name="MakeHTMLBlock">
<xsl:param name="num"/>
<xsl:if test="$num">
<p>
<b>some HTML</b>
</p>
<xsl:call-template name="MakeHTMLBlock">
<xsl:with-param name="num" select="$num - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








