Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XSLTransform class API

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XSLTransform class API
  • Date: Wed, 29 Sep 2010 09:00:57 -0400

On Wed, Sep 29, 2010 at 7:53 AM, Dmitry Katsubo <dma_k AT mail.ru> wrote:

> I attach a test case, that serializes two XML models via XOM and DOMv3
> with same result. Please, point me exactly the line I am wrong or which
> has a pitfall that most of programmers will hit.

Your code uses a StringWriter. Problems arise with something like this:

Writer out = new OutputStreamWriter(new ByteArrayOutputStream(),
"ISO-8859-1");

or even just, depending on platform:

Writer out = new OutputStreamWriter(new ByteArrayOutputStream());

The problem is I have no good way to tell which characters do and do
not need to be escaped given the Writer. A StringWriter can write
anything, as can a CharArrayWriter, but most other writers can't.

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page