cziegeler    2003/01/14 01:54:20

  Modified:    src/java/org/apache/cocoon/environment
                        AbstractEnvironment.java
               src/java/org/apache/cocoon/xml XMLUtils.java
               src/java/org/apache/cocoon/transformation
                        XIncludeTransformer.java
                        SourceWritingTransformer.java
                        CIncludeTransformer.java
               src/java/org/apache/cocoon/xml/dom DOMUtil.java
                        DocumentWrapper.java
               lib/core excalibur-xmlutil-20030114.jar
               src/java/org/apache/cocoon/components/source/impl
                        CocoonToAvalonSource.java SitemapSource.java
               src/java/org/apache/cocoon/components/source SourceUtil.java
  Log:
  Updating to changed interfaces of excalibur
  
  Revision  Changes    Path
  1.32      +3 -3      
xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- AbstractEnvironment.java  14 Jan 2003 08:32:00 -0000      1.31
  +++ AbstractEnvironment.java  14 Jan 2003 09:54:19 -0000      1.32
  @@ -528,8 +528,8 @@
       public void toSAX( org.apache.excalibur.source.Source source,
                          ContentHandler handler )
       throws SAXException, IOException, ProcessingException {
  -        if ( source instanceof org.apache.avalon.excalibur.xml.XMLizable ) {
  -            ((org.apache.avalon.excalibur.xml.XMLizable)source).toSAX( handler );
  +        if ( source instanceof org.apache.excalibur.xml.sax.XMLizable ) {
  +            ((org.apache.excalibur.xml.sax.XMLizable)source).toSAX( handler );
           } else if ( source instanceof org.apache.cocoon.xml.XMLizable ) {
               ((org.apache.cocoon.xml.XMLizable)source).toSAX( handler );
           } else {
  
  
  
  1.12      +4 -4      xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XMLUtils.java     10 Jan 2003 14:18:55 -0000      1.11
  +++ XMLUtils.java     14 Jan 2003 09:54:19 -0000      1.12
  @@ -294,7 +294,7 @@
        * @param v the XML fragment
        */
       public static void valueOf(ContentHandler contentHandler, 
  -                                 org.apache.avalon.excalibur.xml.XMLizable v)
  +                                 org.apache.excalibur.xml.sax.XMLizable v)
       throws SAXException {
           if (v != null) {
               v.toSAX(contentHandler);
  @@ -373,8 +373,8 @@
                return;
            }
            
  -         if (v instanceof org.apache.avalon.excalibur.xml.XMLizable) {
  -             valueOf(contentHandler, (org.apache.avalon.excalibur.xml.XMLizable)v);
  +         if (v instanceof org.apache.excalibur.xml.sax.XMLizable) {
  +             valueOf(contentHandler, (org.apache.excalibur.xml.sax.XMLizable)v);
            }
   
            // Node
  
  
  
  1.14      +24 -16    
xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XIncludeTransformer.java  8 Aug 2002 07:28:32 -0000       1.13
  +++ XIncludeTransformer.java  14 Jan 2003 09:54:19 -0000      1.14
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.transformation;
   
  -import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -65,6 +64,7 @@
   import org.apache.cocoon.xml.dom.DOMStreamer;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  +import org.apache.excalibur.xml.dom.Parser;
   import org.w3c.dom.Document;
   import org.w3c.dom.NodeList;
   import org.xml.sax.Attributes;
  @@ -292,25 +292,35 @@
                   }
               } else if (parse.equals("xml")) {
                   getLogger().debug("Parse type is XML");
  -                Parser parser = null;
                   try {
  -                    parser = (Parser)manager.lookup(Parser.ROLE);
   
                       InputSource input = SourceUtil.getInputSource(url);
   
                       if (suffix.startsWith("xpointer(") && suffix.endsWith(")")) {
  -                        String xpath = suffix.substring(9,suffix.length()-1);
  -                        getLogger().debug("XPath is "+xpath);
  -                        Document document = parser.parseDocument(input);
  -                        NodeList list = processor.selectNodeList(document,xpath);
  -                        DOMStreamer streamer = new 
DOMStreamer(super.contentHandler,super.lexicalHandler);
  -                        int length = list.getLength();
  -                        for (int i=0; i<length; i++) {
  -                            streamer.stream(list.item(i));
  +                        Parser parser = null;
  +                        try {
  +                            parser = (Parser)manager.lookup(Parser.ROLE);
  +                            String xpath = suffix.substring(9,suffix.length()-1);
  +                            getLogger().debug("XPath is "+xpath);
  +                            Document document = parser.parseDocument(input);
  +                            NodeList list = 
processor.selectNodeList(document,xpath);
  +                            DOMStreamer streamer = new 
DOMStreamer(super.contentHandler,super.lexicalHandler);
  +                            int length = list.getLength();
  +                            for (int i=0; i<length; i++) {
  +                                streamer.stream(list.item(i));
  +                            }
  +                        } finally {
  +                            this.manager.release((Component)parser);
                           }
                       } else {
  -                        IncludeXMLConsumer xinclude_handler = new 
IncludeXMLConsumer(super.contentHandler,super.lexicalHandler);
  -                        parser.parse(input, xinclude_handler);
  +                        org.apache.excalibur.xml.sax.Parser parser = null;
  +                        try {
  +                            parser = 
(org.apache.excalibur.xml.sax.Parser)manager.lookup(org.apache.excalibur.xml.sax.Parser.ROLE);
  +                            IncludeXMLConsumer xinclude_handler = new 
IncludeXMLConsumer(super.contentHandler,super.lexicalHandler);
  +                            parser.parse(input, xinclude_handler);
  +                        } finally {
  +                            this.manager.release((Component)parser);
  +                        }
                       }
                   } catch(SAXException e) {
                       getLogger().error("Error in processXIncludeElement", e);
  @@ -327,8 +337,6 @@
                   } catch(ComponentException e) {
                       getLogger().error("Error in processXIncludeElement", e);
                       throw new SAXException(e);
  -                } finally {
  -                    this.manager.release(parser);
                   }
               }
           } catch (SourceException se) {
  
  
  
  1.12      +4 -3      
xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java
  
  Index: SourceWritingTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SourceWritingTransformer.java     5 Dec 2002 10:40:07 -0000       1.11
  +++ SourceWritingTransformer.java     14 Jan 2003 09:54:19 -0000      1.12
  @@ -50,7 +50,7 @@
   */
   package org.apache.cocoon.transformation;
   
  -import org.apache.avalon.excalibur.xml.Parser;
  +import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -67,6 +67,7 @@
   import org.apache.cocoon.xml.dom.DOMUtil;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  +import org.apache.excalibur.xml.dom.Parser;
   import org.w3c.dom.DOMException;
   import org.w3c.dom.Document;
   import org.w3c.dom.DocumentFragment;
  @@ -656,7 +657,7 @@
                                       try {
                                           resource = parser.createDocument();
                                       } finally {
  -                                        this.manager.release( parser );
  +                                        this.manager.release( (Component)parser );
                                       }
   
                                       
resource.appendChild(resource.importNode(importNode, true));
  @@ -695,7 +696,7 @@
                   try {
                       resource = parser.createDocument();
                   } finally {
  -                    this.manager.release( parser );
  +                    this.manager.release( (Component)parser );
                   }
                   // import the fragment
                   Node importNode = resource.importNode(fragment, true);
  
  
  
  1.17      +3 -3      
xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CIncludeTransformer.java  7 Jan 2003 23:17:09 -0000       1.16
  +++ CIncludeTransformer.java  14 Jan 2003 09:54:19 -0000      1.17
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.transformation;
   
  -import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.excalibur.xml.xpath.XPathProcessor;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -63,6 +62,7 @@
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceParameters;
  +import org.apache.excalibur.xml.dom.Parser;
   import org.w3c.dom.Document;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  @@ -377,7 +377,7 @@
                                                  (LexicalHandler)this);
                       }
                   } finally {
  -                    this.manager.release(parser);
  +                    this.manager.release((Component)parser);
                       this.manager.release((Component)processor);
                   }
               } else {
  
  
  
  1.8       +2 -2      xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMUtil.java
  
  Index: DOMUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMUtil.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DOMUtil.java      14 Jan 2003 09:00:29 -0000      1.7
  +++ DOMUtil.java      14 Jan 2003 09:54:19 -0000      1.8
  @@ -52,12 +52,12 @@
   
   import org.apache.excalibur.source.SourceParameters;
   import org.apache.xpath.XPathAPI;
  -import org.apache.avalon.excalibur.xml.XMLizable;
   import org.apache.avalon.excalibur.xml.xpath.XPathProcessor;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.xpath.XPathUtil;
   import org.apache.cocoon.xml.IncludeXMLConsumer;
   import org.apache.excalibur.xml.sax.Parser;
  +import org.apache.excalibur.xml.sax.XMLizable;
   import org.w3c.dom.*;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  
  
  
  1.3       +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DocumentWrapper.java
  
  Index: DocumentWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DocumentWrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DocumentWrapper.java      7 Jan 2003 23:56:12 -0000       1.2
  +++ DocumentWrapper.java      14 Jan 2003 09:54:19 -0000      1.3
  @@ -50,7 +50,7 @@
   */
   package org.apache.cocoon.xml.dom;
   
  -import org.apache.avalon.excalibur.xml.XMLizable;
  +import org.apache.excalibur.xml.sax.XMLizable;
   
   import org.w3c.dom.Attr;
   import org.w3c.dom.CDATASection;
  
  
  
  1.4       +252 -374  xml-cocoon2/lib/core/excalibur-xmlutil-20030114.jar
  
        <<Binary file>>
  
  
  1.6       +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java
  
  Index: CocoonToAvalonSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CocoonToAvalonSource.java 9 Jan 2003 08:09:39 -0000       1.5
  +++ CocoonToAvalonSource.java 14 Jan 2003 09:54:20 -0000      1.6
  @@ -54,12 +54,12 @@
   import java.io.InputStream;
   import java.util.Iterator;
   import org.apache.avalon.excalibur.pool.Recyclable;
  -import org.apache.avalon.excalibur.xml.XMLizable;
   import org.apache.excalibur.source.*;
   import org.apache.excalibur.source.impl.validity.TimeStampValidity;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
   import org.apache.cocoon.environment.ModifiableSource;
  +import org.apache.excalibur.xml.sax.XMLizable;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
   
  
  
  
  1.35      +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- SitemapSource.java        13 Jan 2003 14:38:17 -0000      1.34
  +++ SitemapSource.java        14 Jan 2003 09:54:20 -0000      1.35
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.components.source.impl;
   
  -import org.apache.avalon.excalibur.xml.XMLizable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  @@ -69,6 +68,7 @@
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceNotFoundException;
   import org.apache.excalibur.source.SourceValidity;
  +import org.apache.excalibur.xml.sax.XMLizable;
   import org.xml.sax.Attributes;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.Locator;
  
  
  
  1.12      +3 -3      
xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SourceUtil.java   14 Jan 2003 08:32:01 -0000      1.11
  +++ SourceUtil.java   14 Jan 2003 09:54:20 -0000      1.12
  @@ -103,8 +103,8 @@
                                 ContentHandler handler,
                                 ComponentManager manager )
       throws SAXException, IOException, ProcessingException {
  -        if ( source instanceof org.apache.avalon.excalibur.xml.XMLizable ) {
  -            ((org.apache.avalon.excalibur.xml.XMLizable)source).toSAX( handler );
  +        if ( source instanceof org.apache.excalibur.xml.sax.XMLizable ) {
  +            ((org.apache.excalibur.xml.sax.XMLizable)source).toSAX( handler );
           } else if ( source instanceof org.apache.cocoon.xml.XMLizable ) {
               ((org.apache.cocoon.xml.XMLizable)source).toSAX( handler );
           } else {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to