OutputFormat class

"Garvin Riensche" <[email protected]> Mon, 6 Oct 2003 18:22:39 +0200
Newsgroups gmane.text.xml.sax.general
Message-ID <004d01c38c26$0fdc0830$fe78a8c0@garvin>
hi there,

i want to do the following: write an application that parses an xml file and
outputs the same xml file with additional tags. these additional tags should
include a number telling how often an element tag appears in the current
subtree. so far i have figured out how to count elements und how to parse
and output an xml file. i wrote a class extending defaulthandler and
implemented the methods startelement() and endelement() for counting. my
question is, how to use the outputformat class to create these additional
tags with the couting information in the output.
this is so far my main method:

public static void main(args[0]){
XMLReader xr = new org.apache.xerces.parsers.SAXParser();
MySAXApp handler = new MySAXApp();
xr.setContentHandler(handler);
xr.setErrorHandler(handler);
FileReader r = new FileReader(args[0]);
xr.parse(new InputSource(r));
}

regards,
garvin



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
List: [email protected]
See:  http://www.saxproject.org
https://lists.sourceforge.net/lists/listinfo/sax-users