cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Mauch <ma...@imkenberg.de>
Subject JDOMTransformer
Date Thu, 14 Feb 2002 16:56:37 GMT
Hi All
I made a simple JDOMTransformer. If you like it, i contribute it. Somebody
can commmit it to CVS.
I don't made any tests how the performance is affected by 
this transformer. But is comfortable to use :)

package org.apache.cocoon.transformation;

import org.jdom.Document;
import org.jdom.input.DOMBuilder;
import org.jdom.output.DOMOutputter;
/**
 * Title: A simple JDOM transformer
 * @author Thorsten Mauch
 * @version 1.0
 */

public abstract class AbstractJDOMTransformer extends AbstractDOMTransformer
{


  protected org.w3c.dom.Document transform(org.w3c.dom.Document doc) {
    DOMBuilder builder = new DOMBuilder();
    DOMOutputter outputter = new DOMOutputter();

    try{
      return outputter.output(transform(builder.build(doc)));
    }
    catch(Exception e){
      log.error("Error while JDOMTransformation",e);
      return doc;
    }


  }
  protected abstract Document transform(Document doc);

}

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message