--fix rewrites this one: the correction is
deterministic, and leaves the stylesheet meaning what it meant.
count($x) > 0 and count($x) = 0 make the processor tally the whole
sequence only to learn whether it holds anything. Test existence directly, so
the engine can stop at the first item: exists() and empty() on XSLT 2.0
and later, the bare sequence and not() on 1.0.
Incorrect:
<xsl:if test="count($items) > 0">
<xsl:if test="count($items) = 0">
Correct:
<xsl:if test="exists($items)">
<xsl:if test="empty($items)">
Each comparison that asks only whether it is empty is flagged:
> 0, != 0, = 0, <= 0, >= 1, and < 1, in either operand
order and in their gt, ne, eq, le, ge, and lt spellings. A genuine
count, such as count($x) > 1, is left alone.