cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reuben Christie" <>
Subject how to create XML DOM from SAX event
Date Wed, 03 Dec 2003 18:44:19 GMT

i have tried to extend the AbstractDOMTransformer class. and now i dont find
anyhelp for ,"how to work with transform method"? it takes Document argument
and returns the document.but which other methods do I need to implement. I m
new bie and have started writing transformer straight away so, please help
here is my code.i want to now get the Document object of the sax event that
has come from generator into my transformer.where do I write my code ? do i
have toimplement startElement and endElement methods? or just carry on with
transformer method? and another question is,

what does this transformer passes to next componanat? SAX event or DOM ?

public class MyTransformer
	extends AbstractDOMTransformer
	implements Transformer, DOMBuilder.Listener, Composable, Disposable,
Recyclable {

	public void setup(
		SourceResolver resolver,
		Map objectModel,
		String src,
		Parameters par)
		throws ProcessingException, SAXException, IOException {
	public void parameterize(Parameters parameters) throws ParameterException {
	protected Document transform(Document doc) {
		doc = this.builder.getDocument();
		return doc;

-----Original Message-----
From: Reuben Christie []
Sent: Tuesday, December 02, 2003 11:58 AM
To: Cocoon Apache
Subject: how to create XML DOM from SAX event

Hi all, I m currently writing custom transformer  to connect to external
java program from cocoon. i m stuck here where i need to convert the sax
event into xml DOM object.
I use file generator to read from xml file and then pass it to the
transformer(my custome transformer) in pipeline in this transformer i want
to create the original xml file (anything, either string or DOM object). can
anybody help me out and throw me some ideas how to do that?
anyhelp will be grtly appriciated

thanks alot in advance

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message