If you have a SAXWriter you can write out individual elements via the
write(Element) methods.

However be sure to ensure that you also invoke startDocument() and
endDocument() on your underlying ContentHandler.

James
-------
http://radio.weblogs.com/0112098/

----- Original Message -----
From: Benjamin Kopic
To: [EMAIL PROTECTED]
Sent: Sunday, December 08, 2002 6:28 PM
Subject: [dom4j-user] Outputting a large document as SAX events


Hi

I am trying to figure out how to output a large XML document as SAX events.
Basically, I parse a large XML file using ElementHandler interface to
perform specific operation on the given element and then I would like to
output that element to another file.

So far I have created a SAXWriter which uses XMLWriter as its
ContentHandler, but I am not sure how to initialise the output document
tree. Currently I get a file without a root element and no <? xml ?>
declaration.

Any help is appreciated.

Best regards
--
benjamin kopic
m: +44 (0)780 154 7643
t: +44 (0)20 7794 3090
e: [EMAIL PROTECTED]
w: http://www.panContext.com/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to