Skip to Content.
Sympa Menu

xom-interest - Re: [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: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • To: David Bullock <db AT dawnbreaks.net>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Serialize selected elements to a Writer.
  • Date: Fri, 13 Oct 2006 14:22:06 -0700


On Oct 13, 2006, at 8:27 AM, David Bullock wrote:

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.


XOM can stream output into StAX (or other serializers), also using a public writeElement() method. See http://dsd.lbl.gov/nux/api/nux/xom/ io/StreamingSerializer.html

Wolfgang.




Archive powered by MHonArc 2.6.24.

Top of Page