|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Iterative variation of attributes
Hi,
> I have a template like this...
>
> <xsl:template name="dibujaEje">
>
> <line x1="16%" y1="85%" x2="16%" y2="15%"/>
> <line x1="17%" y1="85%" x2="17%" y2="15%"/>
> : : : :
> <line x1="84%" y1="85%" x2="84%" y2="15%"/>
> <line x1="85%" y1="85%" x2="85%" y2="15%"/>
>
> </xsl:template>
>
>
> The attributes of the element line, x1 and x2 change from
> 16% to 85%...
>
> How i could simplify this and haven't to write all the lines?¿?
<xsl:template name="dibujaEje">
<xsl:param name="start" select="15"/>
<xsl:param name="end" select="85"/>
<xsl:param name="current" select="$start"/>
<xsl:if test="$current <= $end">
<line x1="{$current}%" y1="{$end}%" x2="{$current}%" y2="{$start}%"/>
<xsl:call-template name="dibujaEje">
<xsl:with-param name="start" select="$start"/>
<xsl:with-param name="end" select="$end"/>
<xsl:with-param name="current" select="$current + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Cheers,
Jarno - Chris C: Vengeance Is Mine
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








