A question on Oliver Beckers efficient methods on xslt programming at this link.
We know that using this code, we can eliminate verbose xsl choose method
concat(
substring(Str1,1 div Cond),
substring(Str2,1 div not(Cond))
)
However what can we specify in ‘condition’, just to check for presence or absence of nodes?
we cannot specify
concat(
substring(Str1,1 div test="/node"),
substring(Str2,1 div not(test="/node"))
)
which will throw syntax errors.
Try this expression (where node is the name of the node you want to test):
Or better still
When applied to this XML, then Yes is output
But when applied to this XML, the No is output