I should point out that XQuery, and XSL/XPath 2.0 define
strings as consisting of Unicode scalar values, and indexing
is defined in terms of scalar values.
However DOMString in DOM-2 is defined in terms of UTF-16:
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
(section 1.1.5. The DOMString type).
I've expressed my preference: introduce a "marker" type,
where a marker is a position in a string or a "buffer".
Simple operations (e.g. get next characater, set next character,
or move position) are O(1) regardless of the reresentation used.
--
--Per Bothner
per_at_bothner.com http://per.bothner.com/
Received on Sat Mar 24 2007 - 15:20:42 UTC