Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Escaping C1 controls

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Escaping C1 controls
  • Date: Sat, 17 Jul 2004 21:11:51 -0400

I've had an item in the TODO list for sometime to consider implementing a suggestion of John Cowan's to always escape C1 controls (characters between 0x80 and 0x9F) even if they were available in the current character set. The reasons for doing this are to avoid conflicting with old-fashioned gateways and to make the files more human understandable in their raw source code form, since all those characters are non-printing. I was halfway through implementing this feature when I suddenly realized why I shouldn't do this so I'm going to document that decision here.

The basic problem is that these characters may appear in unescapable situations such as comments and processing instruction data. Requiring these characters to be escaped would basically make documents containing such constructs, unserializable; and I'm not willing to do that. Using these characters in comments or processing instructions or at all may be ill-advised, but it is not malformed so XOM needs to support it.

Longer term, it might be possible to escape these characters in a different context, such as directly in the Serializer, if it seems worth the hassle. I doubt that it is. They are very rarely used in XML. But even if someone comes up with a good reason why XOM should do this, I'm not going to implement this for 1.0. If there's a real demand for it, it shouldn't break anything in the API or implementation and I can add it in 1.0.1, but I suspect this is really just a corner case no one really cares all that much about.

--
Elliotte Rusty Harold



  • [XOM-interest] Escaping C1 controls, Elliotte Harold, 07/17/2004

Archive powered by MHonArc 2.6.24.

Top of Page