Re: xmlwriter and xmlfilter

David Brownell <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.xml
Message-ID <[email protected]>
Luca Dall'Olio wrote:

> Second one:
> How can I send the XmlWriter events through an XmlFilter (I would prefer 

You mean, like by making the writer be the consumer of the events
produced by that XmlReader?

Passing such events "through" an XMLFilter makes no sense to me.
XmlWriter produces text files.  It doesn't care where the SAX
input events come from.  And on the other end, the output is
always (!) going to be text, not SAX events.


> not to use the Gnu Jaxp pipeline package: I would like to write 
> implementation independent code as far as possible), since XmlWriter 
> does not implement the XmlReader interface? Should I extend the 
> XmlWriter to do implement it?

If you like.  "gnu.xml.pipeline" can be used with other implementations,
any dependencies on AElfred2 and the DOM2 code there should all be very
easily configured out if you want to use some other implementation.

When I've done streaming with SAX I've wanted to avoid the XmlFilter
classes as thoroughly as possible; they can't make up its mind whether
it's a data sink or a data source, and that's a pretty basic design
constraint.  You may think differently though.

That said ... the reason XmlWriter is a free-standing class is very
specifically so it avoids lots of overhead.

- Dave
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.