Clay Leeds wrote:
You can also write it this way:

<fo:table-cell>
<xsl:attribute name="number-columns-spanned"><xsl:value-of select="$nb_header"></xsl:value-of>
<fo:block>General comment for header 1, 2, 3</fo:block>
</fo:table-cell>


Does anyone know if one way is "better" than another (read more efficient)?

I didn't meet any implementation where it makes a difference whether you use xsl:attribute or an AVT. The xsl:attribute is more verbose, which may increase parsing time by an insignificant amount. Some poeple like the more verbose way, others are more for AVTs. Note that AVTs can substitute for complicated concat()'s: <foo href="http://{$host}:{$port}{$root}/bar.html"/> Alternative <foo> <xsl:attribute name="href"> <xsl:value-of select="concat( 'http://',$host,':',$port,$root,'/bar.html')"/> </xsl:attribute> </foo> or <foo> <xsl:attribute name="href"> <xsl:text>http://<xsl:text> <xsl:value-of select="$host"/> <xsl:text>:<xsl:text> <xsl:value-of select="$port"/> <xsl:value-of select="$root"/> <xsl:text>/bar.html<xsl:text> </xsl:attribute> </foo> Because XPath 1.0 doesn't have conditional and iteration operators, the latter may be interesting in such cases. (XPath 2.0 will have such operators). Also, xsl:attribute must be used if the attribute name isn't predermined, for example taken from the source XML.

J.Pietschmann


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to