Xslt is for data transformation, and it’s very good at that, but a XSLT-code-file can easily get very complex and hard to read and debug. It’s good to
- simplify the code
- combine it with calls to regular .net-code in assemblies
- separate code in templates
- handle variables in a separate section
- use a good naming convention.
Put variable selects inside the variable tag,
<xsl:variable name="booleanVariable" select="$expression"/>
<xsl:variable name="booleanVariable"><xsl:value-of select="$expression/></xsl:variable>
most important for boolean variables, because they will evaluate to string ‘true’ / ‘false’ if used as in the latter.