xsl-list
[Top] [All Lists]

RE: how to match true and false and display yes and no instead?

2005-07-27 15:03:54
Michael Kay, you say this:

<xsl:template 
match="members/profile/married[.='false']">no</xsl:template>
<xsl:template 
match="members/profile/married[.='true']">yes</xsl:template>

is another way of doing it. Now there are two templates. I have used
<xsl:if> Is templates faster (better) than <xsl:if> ? Or are there
other arguments for using this instead, then I'll change my code.


I don't think I can come up with strong reasons why one of these styles is
preferable to the other. I quite like structuring my code as a large number
of simple rules rather than a smaller number of more complex rules, but it's
a matter of personal style. It's unlikely to make much performance
difference - but that of course depends on the XSLT processor you are using
(and the advantage could be either way).

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--