Can you put two conditions in an xslt test attribute?
Not quite, the AND has to be lower-case. <xsl:when test=”4 < 5 and 1 < 2″> <!– do something –> </xsl:when>
Not quite, the AND has to be lower-case. <xsl:when test=”4 < 5 and 1 < 2″> <!– do something –> </xsl:when>
You need to put the last() indexing on the nodelist result, rather than as part of the selection criteria. Try: (//element[@name=”D”])[last()]
<xsl:if test=”xpath-expression”>…</xsl:if> so for example <xsl:if test=”/html/body”>body node exists</xsl:if> <xsl:if test=”not(/html/body)”>body node missing</xsl:if>
The following XSL code will produce a newline (line feed) character: <xsl:text>
</xsl:text> For a carriage return, use: <xsl:text>
</xsl:text>
Use the entity code   instead. is a HTML “character entity reference”. There is no named entity for non-breaking space in XML, so you use the code  . Wikipedia includes a list of XML and HTML entities, and you can see that there are only 5 “predefined entities” in XML, but HTML has over … Read more
test=”categoryName != ”” Edit: This covers the most likely interpretation, in my opinion, of “[not] null or empty” as inferred from the question, including it’s pseudo-code and my own early experience with XSLT. I.e., “What is the equivalent of the following Java?”: // Equivalent Java, NOT XSLT !(categoryName == null || categoryName.equals(“”)) For more details … Read more