You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by fr...@apache.org on 2002/06/12 18:48:30 UTC

cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib XMLProducerTagSupport.java XMLProducerTag.java XMLConsumerTagSupport.java XMLConsumerTag.java VarXMLProducerTagSupport.java VarTransformerTagSupport.java VarTagSupport.java TransformerTagSupport.java TransformerTag.java TagSupport.java Tag.java IterationTag.java

froehlich    2002/06/12 09:48:30

  Added:       src/scratchpad/src/org/apache/cocoon/taglib
                        XMLProducerTagSupport.java XMLProducerTag.java
                        XMLConsumerTagSupport.java XMLConsumerTag.java
                        VarXMLProducerTagSupport.java
                        VarTransformerTagSupport.java VarTagSupport.java
                        TransformerTagSupport.java TransformerTag.java
                        TagSupport.java Tag.java IterationTag.java
  Log:
  applied patch from olker.schmitt@basf-it-services.com .
  JSP like Tag-Library Implementation
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/XMLProducerTagSupport.java
  
  Index: XMLProducerTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.apache.cocoon.xml.XMLConsumer;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public abstract class XMLProducerTagSupport extends TagSupport implements XMLProducerTag {
      
      protected XMLConsumer xmlConsumer;
  
      /*
       * @see XMLProducer#setConsumer(XMLConsumer)
       */
      public void setConsumer(XMLConsumer xmlConsumer) {
          this.xmlConsumer = xmlConsumer;
      }
      
      /*
       * @see Recyclable#recycle()
       */
      public void recycle() {
          xmlConsumer = null;
          super.recycle();
      }
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/XMLProducerTag.java
  
  Index: XMLProducerTag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.taglib;
  
  import org.apache.cocoon.xml.XMLProducer;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public interface XMLProducerTag extends Tag, XMLProducer {
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/XMLConsumerTagSupport.java
  
  Index: XMLConsumerTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public abstract class XMLConsumerTagSupport extends VarTagSupport implements XMLConsumerTag {
  
      /*
       * @see ContentHandler#characters(char[], int, int)
       */
      public void characters(char[] ch, int start, int length) throws SAXException {
      }
  
      /*
       * @see ContentHandler#endDocument()
       */
      public void endDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#endElement(String, String, String)
       */
      public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
      }
  
      /*
       * @see ContentHandler#endPrefixMapping(String)
       */
      public void endPrefixMapping(String prefix) throws SAXException {
      }
  
      /*
       * @see ContentHandler#ignorableWhitespace(char[], int, int)
       */
      public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
      }
  
      /*
       * @see ContentHandler#processingInstruction(String, String)
       */
      public void processingInstruction(String target, String data) throws SAXException {
      }
  
      /*
       * @see ContentHandler#setDocumentLocator(Locator)
       */
      public void setDocumentLocator(Locator locator) {
      }
  
      /*
       * @see ContentHandler#skippedEntity(String)
       */
      public void skippedEntity(String name) throws SAXException {
      }
  
      /*
       * @see ContentHandler#startDocument()
       */
      public void startDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#startElement(String, String, String, Attributes)
       */
      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
      }
  
      /*
       * @see ContentHandler#startPrefixMapping(String, String)
       */
      public void startPrefixMapping(String prefix, String uri) throws SAXException {
      }
  
      /*
       * @see LexicalHandler#comment(char[], int, int)
       */
      public void comment(char[] ch, int start, int length) throws SAXException {
      }
  
      /*
       * @see LexicalHandler#endCDATA()
       */
      public void endCDATA() throws SAXException {
      }
  
      /*
       * @see LexicalHandler#endDTD()
       */
      public void endDTD() throws SAXException {
      }
  
      /*
       * @see LexicalHandler#endEntity(String)
       */
      public void endEntity(String name) throws SAXException {
      }
  
      /*
       * @see LexicalHandler#startCDATA()
       */
      public void startCDATA() throws SAXException {
      }
  
      /*
       * @see LexicalHandler#startDTD(String, String, String)
       */
      public void startDTD(String name, String publicId, String systemId) throws SAXException {
      }
  
      /*
       * @see LexicalHandler#startEntity(String)
       */
      public void startEntity(String name) throws SAXException {
      }
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/XMLConsumerTag.java
  
  Index: XMLConsumerTag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.taglib;
  
  import org.apache.cocoon.xml.XMLConsumer;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public interface XMLConsumerTag extends Tag, XMLConsumer {
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/VarXMLProducerTagSupport.java
  
  Index: VarXMLProducerTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.apache.cocoon.xml.XMLConsumer;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public abstract class VarXMLProducerTagSupport extends VarTagSupport implements XMLProducerTag {
      
      protected XMLConsumer xmlConsumer;
  
      /*
       * @see XMLProducer#setConsumer(XMLConsumer)
       */
      public void setConsumer(XMLConsumer xmlConsumer) {
          this.xmlConsumer = xmlConsumer;
      }
      
      /*
       * @see Recyclable#recycle()
       */
      public void recycle() {
          xmlConsumer = null;
          super.recycle();
      }
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/VarTransformerTagSupport.java
  
  Index: VarTransformerTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  import org.apache.cocoon.xml.XMLConsumer;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public class VarTransformerTagSupport extends VarTagSupport implements TransformerTag {
      protected XMLConsumer xmlConsumer;
  
      /*
       * @see ContentHandler#setDocumentLocator(Locator)
       */
      public void setDocumentLocator(Locator locator) {
          xmlConsumer.setDocumentLocator(locator);
      }
  
      /*
       * @see ContentHandler#startDocument()
       */
      public void startDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#endDocument()
       */
      public void endDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#startPrefixMapping(String, String)
       */
      public void startPrefixMapping(String prefix, String uri) throws SAXException {
          xmlConsumer.startPrefixMapping(prefix, uri);
      }
  
      /*
       * @see ContentHandler#endPrefixMapping(String)
       */
      public void endPrefixMapping(String prefix) throws SAXException {
          xmlConsumer.endPrefixMapping(prefix);
      }
  
      /*
       * @see ContentHandler#startElement(String, String, String, Attributes)
       */
      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
          xmlConsumer.startElement(namespaceURI, localName, qName, atts);
      }
  
      /*
       * @see ContentHandler#endElement(String, String, String)
       */
      public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
          xmlConsumer.endElement(namespaceURI, localName, qName);
      }
  
      /*
       * @see ContentHandler#characters(char[], int, int)
       */
      public void characters(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.characters(ch, start, length);
      }
  
      /*
       * @see ContentHandler#ignorableWhitespace(char[], int, int)
       */
      public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.ignorableWhitespace(ch, start, length);
      }
  
      /*
       * @see ContentHandler#processingInstruction(String, String)
       */
      public void processingInstruction(String target, String data) throws SAXException {
          xmlConsumer.processingInstruction(target, data);
      }
  
      /*
       * @see ContentHandler#skippedEntity(String)
       */
      public void skippedEntity(String name) throws SAXException {
          xmlConsumer.skippedEntity(name);
      }
  
      /*
       * @see LexicalHandler#startDTD(String, String, String)
       */
      public void startDTD(String name, String publicId, String systemId) throws SAXException {
          xmlConsumer.startDTD(name, publicId, systemId);
      }
  
      /*
       * @see LexicalHandler#endDTD()
       */
      public void endDTD() throws SAXException {
          xmlConsumer.endDTD();
      }
  
      /*
       * @see LexicalHandler#startEntity(String)
       */
      public void startEntity(String name) throws SAXException {
          xmlConsumer.startEntity(name);
      }
  
      /*
       * @see LexicalHandler#endEntity(String)
       */
      public void endEntity(String name) throws SAXException {
          xmlConsumer.endEntity(name);
      }
  
      /*
       * @see LexicalHandler#startCDATA()
       */
      public void startCDATA() throws SAXException {
          xmlConsumer.startCDATA();
      }
  
      /*
       * @see LexicalHandler#endCDATA()
       */
      public void endCDATA() throws SAXException {
          xmlConsumer.endCDATA();
      }
  
      /*
       * @see LexicalHandler#comment(char[], int, int)
       */
      public void comment(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.comment(ch, start, length);
      }
  
      /*
       * @see XMLProducer#setConsumer(XMLConsumer)
       */
      public void setConsumer(XMLConsumer consumer) {
          this.xmlConsumer = consumer;
      }
  
      /*
       * @see Recyclable#recycle()
       */
      public void recycle() {
          this.xmlConsumer = null;
          super.recycle();
      }
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/VarTagSupport.java
  
  Index: VarTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.cocoon.environment.Context;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.environment.Session;
  import org.apache.cocoon.jxpath.JXPathCocoonContexts;
  import org.apache.cocoon.jxpath.JXPathCocoonContexts;
  import org.apache.commons.jxpath.JXPathContext;
  
  /**
   * Add support for setting and getting variables
   * 
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public abstract class VarTagSupport extends TagSupport implements Composable {
      protected String var;
      protected ComponentManager componentManager;
      private JXPathCocoonContexts jxpathContexts;
      private Request request;
  
      /**
       * Get the attribute to store the result in.
       */
      public final String getVar() {
          return this.var;
      }
  
      /**
       * Set the attribute to store the result in.
       */
      public final void setVar(String var) {
          this.var = var;
      }
  
      protected final Request getRequest() {
          if (request == null)
              request = ObjectModelHelper.getRequest(objectModel);
          return request;
      }
  
      protected final Object getVariable(String name) {
          JXPathContext context = getVariableContext();
          if (name.charAt(0) == '$')
              return context.getValue(name);
          else
              return context.getVariables().getVariable(name);
          //getRequest().getAttribute(name);
      }
  
      /**
       * Register the name and object specified.
       *
       * @param name the name of the attribute to set
       * @param attribute  the object to associate with the name
       */
      protected final void setVariable(String name, Object value) {
          JXPathContext context = getVariableContext();
          if (name.charAt(0) == '$')
              context.setValue(name, value);
          else
              context.getVariables().declareVariable(name, value);
          //getRequest().setAttribute(name, value);
      }
  
      protected final void removeVariable(String name) {
          JXPathContext context = getVariableContext();
          if (name.charAt(0) == '$')
              context.setValue(name, null);
          else
              context.getVariables().declareVariable(name, null);
          //getRequest().removeAttribute(name);
      }
  
      private final JXPathContext getVariableContext() {
          if (jxpathContexts == null) {
              try {
                  jxpathContexts = (JXPathCocoonContexts) componentManager.lookup(JXPathCocoonContexts.ROLE);
              } catch (ComponentException e) {
                  //XXX
              }
          }
          return jxpathContexts.getVariableContext();
          //return JXPathCocoonContexts.getVariableContext(objectModel);
      }
  
      /*
       * @see Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager) throws ComponentException {
          this.componentManager = componentManager;
      }
  
      public void recycle() {
          this.var = null;
          this.jxpathContexts = null;
          this.request = null;
          super.recycle();
      }
  }
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/TransformerTagSupport.java
  
  Index: TransformerTagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  import org.apache.cocoon.xml.XMLConsumer;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public class TransformerTagSupport extends TagSupport implements TransformerTag {
      protected XMLConsumer xmlConsumer;
  
      /*
       * @see ContentHandler#setDocumentLocator(Locator)
       */
      public void setDocumentLocator(Locator locator) {
          xmlConsumer.setDocumentLocator(locator);
      }
  
      /*
       * @see ContentHandler#startDocument()
       */
      public void startDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#endDocument()
       */
      public void endDocument() throws SAXException {
      }
  
      /*
       * @see ContentHandler#startPrefixMapping(String, String)
       */
      public void startPrefixMapping(String prefix, String uri) throws SAXException {
          xmlConsumer.startPrefixMapping(prefix, uri);
      }
  
      /*
       * @see ContentHandler#endPrefixMapping(String)
       */
      public void endPrefixMapping(String prefix) throws SAXException {
          xmlConsumer.endPrefixMapping(prefix);
      }
  
      /*
       * @see ContentHandler#startElement(String, String, String, Attributes)
       */
      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
          xmlConsumer.startElement(namespaceURI, localName, qName, atts);
      }
  
      /*
       * @see ContentHandler#endElement(String, String, String)
       */
      public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
          xmlConsumer.endElement(namespaceURI, localName, qName);
      }
  
      /*
       * @see ContentHandler#characters(char[], int, int)
       */
      public void characters(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.characters(ch, start, length);
      }
  
      /*
       * @see ContentHandler#ignorableWhitespace(char[], int, int)
       */
      public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.ignorableWhitespace(ch, start, length);
      }
  
      /*
       * @see ContentHandler#processingInstruction(String, String)
       */
      public void processingInstruction(String target, String data) throws SAXException {
          xmlConsumer.processingInstruction(target, data);
      }
  
      /*
       * @see ContentHandler#skippedEntity(String)
       */
      public void skippedEntity(String name) throws SAXException {
          xmlConsumer.skippedEntity(name);
      }
  
      /*
       * @see LexicalHandler#startDTD(String, String, String)
       */
      public void startDTD(String name, String publicId, String systemId) throws SAXException {
          xmlConsumer.startDTD(name, publicId, systemId);
      }
  
      /*
       * @see LexicalHandler#endDTD()
       */
      public void endDTD() throws SAXException {
          xmlConsumer.endDTD();
      }
  
      /*
       * @see LexicalHandler#startEntity(String)
       */
      public void startEntity(String name) throws SAXException {
          xmlConsumer.startEntity(name);
      }
  
      /*
       * @see LexicalHandler#endEntity(String)
       */
      public void endEntity(String name) throws SAXException {
          xmlConsumer.endEntity(name);
      }
  
      /*
       * @see LexicalHandler#startCDATA()
       */
      public void startCDATA() throws SAXException {
          xmlConsumer.startCDATA();
      }
  
      /*
       * @see LexicalHandler#endCDATA()
       */
      public void endCDATA() throws SAXException {
          xmlConsumer.endCDATA();
      }
  
      /*
       * @see LexicalHandler#comment(char[], int, int)
       */
      public void comment(char[] ch, int start, int length) throws SAXException {
          xmlConsumer.comment(ch, start, length);
      }
  
      /*
       * @see XMLProducer#setConsumer(XMLConsumer)
       */
      public void setConsumer(XMLConsumer consumer) {
          this.xmlConsumer = consumer;
      }
  
      /*
       * @see Recyclable#recycle()
       */
      public void recycle() {
          this.xmlConsumer = null;
          super.recycle();
      }
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/TransformerTag.java
  
  Index: TransformerTag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.taglib;
  
  import org.apache.cocoon.xml.XMLConsumer;
  
  /**
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public interface TransformerTag extends XMLConsumer, XMLProducerTag {
  
  }
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/TagSupport.java
  
  Index: TagSupport.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import java.util.Map;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  import org.apache.avalon.framework.logger.AbstractLoggable;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.environment.Context;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.environment.Session;
  import org.apache.cocoon.environment.SourceResolver;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.SAXException;
  
  /**
   * Abstract implementation for all Tags
   * 
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public abstract class TagSupport extends AbstractLoggable implements Tag, Recyclable {
      protected String var;
      protected Tag parent;
      protected SourceResolver resolver;
      protected Map objectModel;
      protected Parameters parameters;
      private Request request;
  
      /**
       * Find the instance of a given class type that is closest to a given
       * instance.
       * This method uses the getParent method from the Tag
       * interface.
       * This method is used for coordination among cooperating tags.
       *
       * @param from The instance from where to start looking.
       * @param klass The subclass of Tag or interface to be matched
       * @returns the nearest ancestor that implements the interface
       * or is an instance of the class specified
       */
      public static final Tag findAncestorWithClass(Tag from, Class klass) {
          boolean isInterface = false;
  
          if (from == null || klass == null || (!Tag.class.isAssignableFrom(klass) && !(isInterface = klass.isInterface()))) {
              return null;
          }
  
          for (;;) {
              Tag tag = from.getParent();
  
              if (tag == null) {
                  return null;
              }
  
              if ((isInterface && klass.isInstance(tag)) || klass.isAssignableFrom(tag.getClass()))
                  return tag;
              else
                  from = tag;
          }
      }
  
      /**
       * Process the end tag for this instance.
       *
       * @returns EVAL_PAGE.
       * @throws SAXException.
       */
      public int doEndTag(String namespaceURI, String localName, String qName) throws SAXException {
          return EVAL_PAGE;
      }
  
      /**
       * Process the start tag for this instance.
       * <p>
       * The doStartTag method assumes that pageContext and
       * parent have been set. It also assumes that any properties exposed as
       * attributes have been set too. When this method is invoked, the body
       * has not yet been evaluated.
       *
       * @returns EVAL_BODY or SKIP_BODY.
       */
      public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
          return EVAL_BODY;
      }
  
      /**
       * Searches for the named attribute in request, session (if valid),
       * and application scope(s) in order and returns the value associated or
       * null.
       *
       * @return the value associated or null
       */
      public final Object findAttribute(String name) {
          if (request == null)
              request = ObjectModelHelper.getRequest(objectModel);
          Object o = request.getAttribute(name);
          if (o != null)
              return o;
  
          Session session = request.getSession(false);
          if (session != null) {
              o = session.getAttribute(name);
              if (o != null)
                  return o;
          }
          Context context = ObjectModelHelper.getContext(objectModel);
          return context.getAttribute(name);
      }
  
      /**
       * Get the parent (closest enclosing tag handler) for this tag handler.
       *
       * @returns the current parent, or null if none.
       */
      public final Tag getParent() {
          return parent;
      }
  
      public void recycle() {
          getLogger().debug("recycle");
          this.var = null;
          this.parent = null;
          this.resolver = null;
          this.objectModel = null;
          this.parameters = null;
          this.request = null;
      }
  
      /**
       * Set the parent (closest enclosing tag handler) of this tag handler.
       * Invoked by the TagTransformer prior to doStartTag().
       * <p>
       * This value is *not* reset by doEndTag() and must be explicitly reset
       * by a Tag implementation.
       *
       * @param parent, the parent tag, or null.
       */
      public final void setParent(Tag parent) {
          this.parent = parent;
      }
  
      /**
       * Set the <code>SourceResolver</code>, objectModel <code>Map</code>
       * and sitemap <code>Parameters</code> used to process the request.
       */
      public void setup(SourceResolver resolver, Map objectModel, Parameters parameters) {
          this.resolver = resolver;
          this.objectModel = objectModel;
          this.parameters = parameters;
      }
  }
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/Tag.java
  
  Index: Tag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import java.io.IOException;
  import java.util.Map;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.environment.SourceResolver;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.SAXException;
  
  /**
   * The Tag implementation works like a JSP Tag but generate SAX output
   * instead of writing to a OutputStream. The equivalent to the JSPEngine
   * is implemented as a Transformer.
   * 
   * @see TagTransformer
   * 
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public interface Tag extends Component {
      
      String ROLE = Tag.class.getName();
  
      /**
       * Evaluate body content
       * Valid return value for doStartTag.
       */
      int EVAL_BODY = 0;
  
      /**
       * Skip body evaluation.
       * Valid return value for doStartTag.
       */
      int SKIP_BODY = 1;
  
      /**
       * Continue evaluating the page.
       * Valid return value for doEndTag().
       */
      int EVAL_PAGE = 2;
  
      /**
       * Process the end tag for this instance.
       *
       * @returns EVAL_PAGE.
       * @throws SAXException.
       */
      int doEndTag(String namespaceURI, String localName, String qName) throws SAXException;
  
      /**
       * Process the start tag for this instance.
       * <p>
       * The doStartTag method assumes that parent have been set.
       * It also assumes that any properties exposed as
       * attributes have been set too. When this method is invoked, the body
       * has not yet been evaluated.
       *
       * @returns EVAL_BODY or SKIP_BODY.
       */
      int doStartTag(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException;
  
      /**
       * Get the parent (closest enclosing tag handler) for this tag handler.
       *
       * @returns the current parent or null if none.
       */
      Tag getParent();
  
      /**
       * Set the <code>SourceResolver</code>, objectModel <code>Map</code>
       * and sitemap <code>Parameters</code> used to process the request.
       */
      void setup(SourceResolver resolver, Map objectModel, Parameters parameters) throws SAXException, IOException;
  
      /**
       * Set the parent (closest enclosing tag handler) of this tag handler.
       * Invoked by the implementation object prior to doStartTag().
       *
       * @param parent The parent tag or null.
       */
      void setParent(Tag parent);
  }
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/taglib/IterationTag.java
  
  Index: IterationTag.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.taglib;
  
  import org.xml.sax.SAXException;
  
  /**
   * The IterationTag interface extends Tag by defining one additional
   * method that controls the reevaluation of its body.
   *
   * <p> A tag handler that implements IterationTag is treated as one that
   * implements Tag regarding  the doStartTag() and doEndTag() methods.
   * IterationTag provides a new method: <code>doAfterBody()</code>.
   *
   * <p> The doAfterBody() method is invoked after every body evaluation
   * to control whether the body will be reevaluated or not.  If doAfterBody()
   * returns IterationTag.EVAL_BODY_AGAIN, then the body will be reevaluated.
   * If doAfterBody() returns Tag.SKIP_BODY, then the body will be skipped
   * and doEndTag() will be evaluated instead.
   *
   * @author: <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a> 
   */
  public interface IterationTag extends Tag {
  
      /**
       * Request the reevaluation of some body.
       * Returned from doAfterBody.
       */
      public final static int EVAL_BODY_AGAIN = 2;
  
      /**
       * Process body (re)evaluation.  This method is invoked by the
       * Taglib implementation object after every evaluation of
       * the body into the BodyEvaluation object. The method is
       * not invoked if there is no body evaluation.
       *
       * <p>
       * If doAfterBody returns EVAL_BODY_AGAIN, a new evaluation of the
       * body will happen (followed by another invocation of doAfterBody).
       * If doAfterBody returns SKIP_BODY no more body evaluations will
       * occur and then doEndTag will be invoked.
       *
       * <p>
       * The method re-invocations may be lead to different actions because
       * there might have been some changes to shared state, or because
       * of external computation.
       *
       * @return whether additional evaluations of the body are desired
       * @throws SAXException
       */
      int doAfterBody() throws SAXException;
  }
  
  
  

----------------------------------------------------------------------
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