[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: size?

Subject: Re: size?
From: "Steve Muench" <SMUENCH@xxxxxxxxxxxxx>
Date: 12 May 99 20:17:10 -0700
string datatype size
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:  http://www.mulberrytech.com/xsl/xsl-list

--- End Message ---
Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.