XSLT Conditions
by , 05-25-2011 at 09:30 AM (1669 Views)
Consider the scenario: You have xml data and you need to filter some data out. You may do that in Java but its open a good idea to keep the logic separate in XSLT filters.
if-then-else condition is done the following way in XSLT:
If you only want a simple if condition, then you should use the following:Java Code:<xsl:choose> <xsl:when test="..."> ... </xsl:when> <xsl:when test="..."> ... </xsl:when> <xsl:otherwise> ... </xsl:otherwise> </xsl:choose>
Logical AND amd OR are always helpful. The above condition reads like: if the value of "x" exists and the value of "y" exists and the value of "z" then do something.Java Code:<xsl:if test="{$x && $y && $z}"> .... </xsl:if>









Email Blog Entry
Size Reduced for Images in PDF &...
05-15-2013, 05:53 PM in Java Software