Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] NFC serialization

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT mercury.ccil.org>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] NFC serialization
  • Date: Mon, 20 Oct 2003 21:00:33 -0400

Elliotte Rusty Harold scripsit:

> I am not, however, perfectly happy with the names for these methods.
> Would anyone care to suggest alternatives? I considered
> setUnicodeNormalization and getUnicodeNormalization (or perhaps
> isUnicodeNormalizing), but that's not quite specific enough, because
> there are four Unicode normalization forms and I only intend to
> support NFC. Ideas?

set/getUnicodeNFC.

> Also, what should happen when setNFC() is invoked on a serializer
> using a non-Unicode encoding, e.g. ISO-8859-1 or EBCDIC? Should the
> serializer simply ignore the request, or should it throw some sort of
> exception? If so, which exception is appropriate here? Thoughts?

Neither. The righteous thing is to normalize first and then use your
smart transcoding algorithm. So if an attribute value or character
content contains U+0041 U+0301 U+0042 U+0301, normalization will transform
it to U+00C1 U+0042 U+0301, and transcoding to ISO-8859-1 will produce
"áb&#x0301;", which is normalized in both the Unicode and the extended
XML sense, and will read back correctly.

--
Business before pleasure, if not too bloomering long before.
--Nicholas van Rijn
John Cowan <jcowan AT reutershealth.com>
http://www.ccil.org/~cowan
http://www.reutershealth.com




Archive powered by MHonArc 2.6.24.

Top of Page