cziegeler 2002/06/13 04:25:48 Modified: src/java/org/apache/cocoon/components/source SourceUtil.java src/java/org/apache/cocoon/components/treeprocessor DefaultTreeBuilder.java Log: Cleaned up code Revision Changes Path 1.5 +3 -1 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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SourceUtil.java 13 Jun 2002 09:28:15 -0000 1.4 +++ SourceUtil.java 13 Jun 2002 11:25:48 -0000 1.5 @@ -92,6 +92,8 @@ throws SAXException, IOException, ProcessingException { if ( source instanceof org.apache.avalon.excalibur.xml.XMLizable ) { ((org.apache.avalon.excalibur.xml.XMLizable)source).toSAX( handler ); + } else if ( source instanceof org.apache.cocoon.xml.XMLizable ) { + ((org.apache.cocoon.xml.XMLizable)source).toSAX( handler ); } else { XMLizer xmlizer = null; try { 1.9 +2 -21 xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java Index: DefaultTreeBuilder.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DefaultTreeBuilder.java 13 Jun 2002 09:28:15 -0000 1.8 +++ DefaultTreeBuilder.java 13 Jun 2002 11:25:48 -0000 1.9 @@ -85,7 +85,6 @@ import org.apache.cocoon.environment.SourceResolver; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; -import org.apache.excalibur.xmlizer.XMLizer; import org.apache.cocoon.sitemap.PatternException; import org.apache.cocoon.util.ClassUtils; @@ -385,25 +384,7 @@ try { // Build a namespace-aware configuration object NamespacedSAXConfigurationHandler handler = new NamespacedSAXConfigurationHandler(); - if ( source instanceof org.apache.avalon.excalibur.xml.XMLizable ) { - ((org.apache.avalon.excalibur.xml.XMLizable)source).toSAX( handler ); - } else if ( source instanceof org.apache.cocoon.xml.XMLizable ) { - ((org.apache.cocoon.xml.XMLizable)source).toSAX( handler ); - } else { - XMLizer xmlizer = (XMLizer)this.parentManager.lookup(XMLizer.ROLE); - try { - xmlizer.toSAX( source.getInputStream(), - source.getMimeType(), - source.getSystemId(), - handler ); - } catch (SourceException se) { - throw SourceUtil.handle(se); - } catch (ComponentException ce) { - throw new ProcessingException("Exception during streaming source.", ce); - } finally { - this.parentManager.release(xmlizer); - } - } + SourceUtil.toSAX( source, handler, this.parentManager ); Configuration treeConfig = handler.getConfiguration(); return build(treeConfig);
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]