Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Electively preserving whitespace

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] Electively preserving whitespace
  • Date: Fri, 28 Mar 2014 14:14:29 -0400

Do you have a minimal example that demonstrates your issue? The default
setting should preserve all significant white space including ignorable
white space and boundary white space. If you told the serializer to adjust
white space, e.g. by setting a max line length; all bets are off.


On Fri, Mar 28, 2014 at 10:37 AM, <nu.xom AT io7m.com> wrote:

> On Thu, 27 Mar 2014 12:19:06 +0000
> <nu.xom AT io7m.com> wrote:
>
> > On Thu, 27 Mar 2014 11:30:22 +0000
> > <nu.xom AT io7m.com> wrote:
> >
> > > Hello.
> > >
> > > I'm processing some XML into XHTML, and have a few elements where
> > > whitespace must be preserved (in order to essentially be inserted
> > > directly into XHTML <pre> elements). I want to use the Serializer to
> > > get indenting, but want to be able to avoid damaging the whitespace
> > > inside the few elements where it should be preserved.
> > >
> > > Is there a way to achieve this?
> >
> > To answer my own question: Adding an xml:space="preserve" attribute on
> > the resulting <pre> element seems to make XOM do the right thing.
>
> Actually, to refute my own answer, this results in XHTML that's not
> XHTML 1.0 Strict. Elements can't have the xml:space attribute, but are
> required in order to stop the Serializer from mangling the contents...
>
> I'm open to suggestions.
>
> M
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>



--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page