3 ms·
Unfortunately, it's still valid for the most part. You can't reassign variables, but instead are forced to if-blocks within variable assignments to e.g. assign
by r00fus 10y ago
Unfortunately, it's still valid for the most part. You can't reassign variables, but instead are forced to if-blocks within variable assignments to e.g. assign c node if it exists, otherwise b.
<xsl:variable name="BorC">
<xsl:choose>
<xsl:when test="/a/b/c">
<xsl:value-of select="/a/b/c">
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/a/b">
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- trmsw 10y agoXPath 2 supports conditionals so you could put all that in a single select expression.