[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Output a default value for an empty node


Subject: RE: [xsl] Output a default value for an empty node
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 15:02:47 +0100

> 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/


Current Thread
Keywords