cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml/dom DOMBuilder.java
Date Sun, 10 Mar 2002 02:15:02 GMT
vgritsenko    02/03/09 18:15:02

  Modified:    src/java/org/apache/cocoon/xml/dom DOMBuilder.java
  Log:
  Patch from Peter Seiderer [Peter.Seiderer@ciselant.de]
  
  Revision  Changes    Path
  1.7       +19 -2     xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMBuilder.java	22 Feb 2002 07:03:59 -0000	1.6
  +++ DOMBuilder.java	10 Mar 2002 02:15:02 -0000	1.7
  @@ -63,7 +63,7 @@
    * DOM Document from SAX events.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: DOMBuilder.java,v 1.6 2002/02/22 07:03:59 cziegeler Exp $
  + * @version CVS $Id: DOMBuilder.java,v 1.7 2002/03/10 02:15:02 vgritsenko Exp $
    */
   public class DOMBuilder
   extends AbstractXMLPipe {
  @@ -77,6 +77,9 @@
       /** The result */
       protected DOMResult result;
   
  +    /** The parentNode */
  +    protected Node parentNode;
  +
       /**
        * Construct a new instance of this TreeGenerator.
        */
  @@ -125,6 +128,7 @@
               TransformerHandler handler = factory.newTransformerHandler();
               this.setContentHandler(handler);
               this.setLexicalHandler(handler);
  +            this.parentNode = parentNode;
               if (parentNode != null) {
                   this.result = new DOMResult( parentNode );
               } else {
  @@ -151,7 +155,20 @@
        */
       public void recycle() {
           super.recycle();
  -        this.result = null;
  +
  +        try {
  +            TransformerHandler handler = factory.newTransformerHandler();
  +            this.setContentHandler(handler);
  +            this.setLexicalHandler(handler);
  +            if (this.parentNode != null) {
  +                this.result = new DOMResult(this.parentNode);
  +            } else {
  +                this.result = new DOMResult();
  +            }
  +            handler.setResult(this.result);
  +        } catch (javax.xml.transform.TransformerException local) {
  +            throw new RuntimeException("Fatal-Error: Unable to get transformer handler");
  +        }
       }
   
       /**
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message