xsl-list
[Top] [All Lists]

RE: Output a default value for an empty node

2004-10-06 07:02:47
test="string(member_name)"

because that saves it counting the length of a string 
(strings used in a
test are true if non-empty, so you don't really need the 
length) on the
other hand Mike will probably tell us saxon special cases 
tests against
string-length = 0 and produces the same code in both cases.


Indeed, it does.

string-length() is a more expensive function than you might imagine because
of the need to go through the string looking for Unicode surrogate pairs
(assuming strings are stored in UTF-16, as they are in Java).

Michael Kay
http://www.saxonica.com/