You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by br...@apache.org on 2003/10/08 14:38:58 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/generation SessionAttributeGenerator.java

bruno       2003/10/08 05:38:58

  Modified:    src/java/org/apache/cocoon/generation
                        SessionAttributeGenerator.java
  Log:
  Fixed double start/endDocument calls in case the session attribute is a DOM document.
  
  Revision  Changes    Path
  1.3       +5 -4      cocoon-2.1/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java
  
  Index: SessionAttributeGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SessionAttributeGenerator.java	16 Mar 2003 17:49:15 -0000	1.2
  +++ SessionAttributeGenerator.java	8 Oct 2003 12:38:58 -0000	1.3
  @@ -57,6 +57,7 @@
   import org.apache.cocoon.environment.Session;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.xml.XMLUtils;
  +import org.apache.cocoon.xml.IncludeXMLConsumer;
   import org.apache.excalibur.xml.sax.XMLizable;
   import org.w3c.dom.Node;
   import org.xml.sax.SAXException;
  @@ -133,7 +134,7 @@
           }
   
           // Get the object to stream
  -        Request request = (Request)ObjectModelHelper.getRequest(objectModel);
  +        Request request = ObjectModelHelper.getRequest(objectModel);
           Session session = request.getSession(false);
           if (session != null) {
               this.attrObject = session.getAttribute(attrName);
  @@ -176,10 +177,10 @@
   
           if (this.elementName != null) {
               xmlConsumer.startElement("", this.elementName, this.elementName, new AttributesImpl());
  -            XMLUtils.valueOf(xmlConsumer, this.attrObject);
  +            XMLUtils.valueOf(new IncludeXMLConsumer(xmlConsumer), this.attrObject);
               xmlConsumer.endElement("", this.elementName, this.elementName);
           } else {
  -            XMLUtils.valueOf(xmlConsumer, this.attrObject);
  +            XMLUtils.valueOf(new IncludeXMLConsumer(xmlConsumer), this.attrObject);
           }
           
           xmlConsumer.endDocument();