[Xsl] tips & tricks

Supponiamo di voler chiudere un tag in una certa condizione. Solitamente il parser dà un errore, affermando che non si può chiudere un tag precedentemente aperto; per ovviare a questo problema si può usare il seguente trucco: scrivere il <> incodati all'interno di un xsl:text. Per esempio, per chiudere un TD ogni 10 nodi:

<xsl:if test="position() = $ElementsForColumn">
<xsl:text disable-output-escaping="yes">
&lt;/td&gt; &lt;td&gt;
</xsl:text>
</xsl:if>

Nessun commento: