Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] XML whitespace in text

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: ksclarke AT
  • To: xom-interest AT
  • Subject: [XOM-interest] XML whitespace in text
  • Date: Wed, 28 May 2003 13:23:23 -0700


I read in the archive that if I set indent I should be willing to let
XOM remove any whitespaces and hard returns. I can understand this more
for elements, but I'm wondering whether this is needed for attribute
values and comments. I would like to have whitespaces and hard returns
respected here, because I have attributes that contain nothing but a
space (the space is significant) and comments that have large chunks of
info that is made easier to read by the existence of hard returns.

I've looked at TextWriter and I can easily change it to respect
whitespace in attributes by toggling the preserveSpace before and after
I write the attribute value. I can also override the write(Comment) in
my XML writer that extends Serializer to do the same thing before it
writes, but I'm wondering if others might also find value in having
these two things escape the reformatting when pretty printing...

Thanks for your thoughts, Kevin

Archive powered by MHonArc 2.6.24.

Top of Page