classpathx-xml
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-xml] xmlwriter and xmlfilter


From: Luca Dall'Olio
Subject: Re: [Classpathx-xml] xmlwriter and xmlfilter
Date: Tue, 28 Jan 2003 15:06:48 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2) Gecko/20021126

Nic Ferrier wrote:
Luca Dall'Olio <address@hidden> writes:


I am on thesis on archiving *huge* quantities of xml-signed data.
Among other things I have to write a single xml file more than 4 Gb size
(1 dvd) so I decided to use Sax.

Since the Xerces default content handler does not have a flush() method
(it keeps everything in memory until the endDocument() method call), I
changed to Dom4j XmlWriter and then I changed again to Gnu Jaxp
XmlWriter, because Dom4j does not produce canonalized output.
Now I would like to send the canonalized sax events to a digester in
order to produce the document hash and then prettyprint the sax events
into an outputstream (the final file).

First question:
Do you think that I chose the right approach?


Broadly, yes.

Second one:
How can I send the XmlWriter events through an XmlFilter (I would prefer
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?


Why can't you filter the events before they get to the XmlWriter?
using an ordinary SAX chain


Nic




I could not understand why XmlFilter has to be at the end of the event chain, now I do. I cannot use an ordinary SAX chain because I need to produce both Pretty Printed and Canonicalized Xml at the same time, in order to write a nice .xml file and calculate an hash out of it. My actual solution (it works!) is to fire SAX events using a TeeConsumer and then serialize with a couple of TextConsumers. Thank you very much for your helpful suggestions!
Luca Dall'Olio






reply via email to

[Prev in Thread] Current Thread [Next in Thread]