Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] How to Serialize With Indenting Without Altering Newlines?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Randall R Schulz <rschulz AT sonic.net>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] How to Serialize With Indenting Without Altering Newlines?
  • Date: Tue, 28 Nov 2006 15:38:10 -0800

Hi,

I'm putting a String that sometimes contains newlines into a Text
element. When I serialize those elements with an indent and a MaxLength
in force, the newlines appear to have been replaced with plain spaces
and the text wraps into a block / blob. Not invoking
Serializer.setMaxLength() doesn't stop this alteration, though of
course now the text just wraps at the terminal boundary when I print it
to a terminal emulator. So apparently using Serializer.setIndent(n)
with n > 0 is what triggers it.

This is not critical, since this output mode (under the control of
a "pretty-print" option) is meant only for human consumption (the
program is actually an importer for an eXist database), but I'd like to
know if I can get the indenting without having text elements altered in
this way. Can I?


Thanks.

Randall Schulz




Archive powered by MHonArc 2.6.24.

Top of Page