bug-classpath
[Top][All Lists]
Advanced

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

[Bug xml/27687] Add support for the "http://javax.xml.transform.sax.SAXT


From: lars at koedderitzsch dot net
Subject: [Bug xml/27687] Add support for the "http://javax.xml.transform.sax.SAXTransformerFactory/feature"
Date: 7 Jun 2006 08:31:32 -0000


------- Comment #2 from lars at koedderitzsch dot net  2006-06-07 08:31 -------
I think I did not make entirely clear what I am doing.

I am using the SaxTransformerFactory to create a TransformerHandler (here doing
an identity transformation):
TransformerHandler handler = saxFactory.newTransformerHandler();

The TransformerHandler gets the Result object which is a stream to the file
being written:
StreamResult result = new StreamResult(out);
handler.setResult(result);

Now this TransformerHandler can be used to programmatically "fire" SAX-Events
into - which will lead to the according XML to be written to the output stream:

handler.startDocument();
handler.startElement(...);
handler.endElement(...);
handler.endDocument();

I hope you get the idea.
I currently don't see how the same can be achieved using the SAXResult class,
but I'd be happy for an example.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27687





reply via email to

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