I need a test for a variable which would evaluate to true in two cases:
- There is a string inside which contains any non white space characters
- There is any node (which can be possibly empty)
and the variable is filled with apply-template call result.
I tried
test="normalize-space($var)"
but this doesn’t cover the empty tag possibility. I also tried simply this:
test="$var"
but this evaluate to true even for white space only strings.
By the way “$var/*” produces an error “Expression …something I don’t remember… node-set” which is I think because of apply-template variable instantiation.
Is there any (which means even multi level decision) solution for this?
EDIT: I forgot to say that it’s for XSLT 1.0 and preferably without any exslt extensions or similar.
If you want to check whether a result tree fragment contains any child nodes then you need exsl:node-set e.g.
Without that extension function (or a similar one your particular XSLT 1.0 processor offers) you can’t perform that check.