Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Serialize selected elements to a Writer.

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Ed Davies <edavies AT nildram.co.uk>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Serialize selected elements to a Writer.
  • Date: Mon, 16 Oct 2006 18:50:57 +0100

David Bullock wrote:
My own ruminations tend towards the idea that the Writer should itself be
performing the escaping, since the target encoding of the Writer is private?

Writer can't perform the escaping because it doesn't know that
it's writing XML.

That Writer's behaviour with unsupported characters is undefined
and that OutputStreamWriter seems to write substitution sequences
for them are both flaws in the design of java.io, in my humble
opinion. I think it would be safer if the defined behaviour was
to throw an exception, at least by default, to avoid silent data
loss.

Ed.





Archive powered by MHonArc 2.6.24.

Top of Page