wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes Write an XML file with SAX? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Write an XML file with SAX?" Watch "Write an XML file with SAX?" New topic

Write an XML file with SAX?

Nils Persson

Joined: May 25, 2001
Posts: 21
Am I able to write an XML file from the beginning using SAX? (beginning = write tags etc from scratch)Or is it only possible to parse the existing XML file with SAX?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12769
You can write a class that generates a complete set of SAX events just as if it was parsing a document and connect it to one of the stock SAX transformers to create output. Thats what Cocoon does - sorry I can't remember the exact class right now.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Write an XML file with SAX?