Re: size?

Subject: Re: size?
From: "Steve Muench" <SMUENCH@xxxxxxxxxxxxx>
Date: 12 May 99 20:17:10 -0700
By "size()" of a "string datatype" do you mean the 
length of the string? in characters or bytes? It turns 
out that the notion of the "length" of a string is 
naturally and conveniently defined if you restrict 
yourself to single-byte character sets, but for multibyte 
character sets the notion of "length" is less well-defined. 
(for example, some character sets use a fixed number 
of bytes per character while others use a multiple 
number of bytes per character with some taking one byte 
and others taking 2 or three bytes). 
Many of these i18n issues are still under debate in  
various W3C working groups, so XSLT at the moment has 
resisted the need to define what a "character" means. 
Hence, there is no way to ask for the length of a string. 
That's also the reason why a substring is specified in 
terms of a delimiter string rather than an index. 
One can obviously imagine simple XSLT extension functions 
that, for a given set of internationalization assumptions 
which can be made for a certain application/site, would 
return the length() of a string, so it's not impossible, 
just not part of the standard. 
P.S. Maybe there is some guidance that PERL implementations 
     could lend here if they have nailed this notion for 
     multibyte languages in an unambiguous way, but I 
     must admit that I'm not PERL-savvy enough to know. 
Steve Muench, Consulting Product Manager & XML Evangelist 
Business Components for Java Dev't Team
--- Begin Message ---
Subject: Re: size?
From: "Larry Fitzpatrick" <lef@xxxxxxxxxxxx>
Date: 12 May 99 14:28:47

Thanks for explaining.

> The size() function was replaced by the count() 
> function before the 21-Apr-1999 draft went public 
> and it looks like James must have missed this 
> one occurrence of size(). 
> So you should be able to use "count(from-ancestors(orderedlist)) mod 3" 
> in this example. 

Ouch. What if I want to determine the "size" of a string datatype? I cannot find any
way to do this. 


 XSL-List info and archive:

--- End Message ---
Current Thread