How to check if an apply-template filled variable is a string or (possibly) empty node in XSLT?
- by calavera.info
I need a test 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)
on a variable that 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.