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

Re: Unicode and XSL (was substring())

Subject: Re: Unicode and XSL (was substring())
From: Paul Prescod <paul@xxxxxxxxxxx>
Date: Sat, 05 Jun 1999 20:34:04 -0500
unicode in xsl
David Carlisle wrote:
> 
> Harder are characters out of the basic plane of unicode. These are a
> single character in XML eg accessed by a single &#1234; but since
> they don't fit into 16bits, they take up two slots when the unicode
> is encoded in utf-16. So the natural thing to do is to count these
> characters as single characters, but that means string indexing requires
> walking the string and thus proportional to the index rather than being
> a constant time array lookup. It also means that indexing and string
> length give different values if you use a `pure XML' approach or if
> you escape out to some language that treats strings as an array of 16bit
> quantities.

Why are you worrying about the encoding? If your programming language is
broken in its handling of the platonic ideal concept of characters then
that is the XSL implementor's problem. There are ways of getting this
right: you can just use 32 bit characters or you can switch your character
width or iteration algoritm based on the actual contents of a string. This
isn't trivial but it is an implementor's problem and should not be
reflected in XSL.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Silence," wrote Melville, "is the only Voice of God." The assertion,
like its subject, cuts both ways, negating and affirming, implying both
absence and presence, offering us a choice; it's a line that the Society
of American Atheists could put on its letterhead and the Society of
Friends could silently endorse while waiting to be moved by the spirit
to speak. - Listening for Silence by Mark Slouka, Apr. 1999, Harper's


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.