Skip to Content.
Sympa Menu

xom-interest - [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: "David Bullock" <db AT dawnbreaks.net>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Serialize selected elements to a Writer.
  • Date: Sat, 14 Oct 2006 01:27:33 +1000

Just reporting that my use-case, where I am using XOM as part of an XML
templating scheme, isn't handled by Serializer. Not willing to write my
own, I figured I'd just complain about it :-)

Specifically, it would have been useful if:

a) Serializer took a java.io.Writer in one of its constructors, since this
is all that pageContext.getOut() can supply me with;

b) writeElement() [?] was public

I coped anyhow, using Node.toXML(), but I did begrudge the StringBuffering
(or StringBuildering) that inevitably is incurred.

To be fair, when and if the memory footprint really starts to hurt, I'll
probably go with StAX instead, but I found Node.query(String xpath)
compelling enough to stay with XOM for now (I guess that means that actually
I would migrate to TrAX rather than StAX). I found it to be a nice feature,
thanks.

cheers,
David.




Archive powered by MHonArc 2.6.24.

Top of Page