You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gk...@apache.org on 2007/05/03 21:58:53 UTC

svn commit: r534978 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java

Author: gkossakowski
Date: Thu May  3 12:58:52 2007
New Revision: 534978

URL: http://svn.apache.org/viewvc?view=rev&rev=534978
Log:
Second attempt to use org.apache.cocoon.core.xml.SAXParser instead of org.apache.excalibur.xml.sax.SAXParser.
See this discussion: http://thread.gmane.org/gmane.text.xml.cocoon.devel/72927

Modified:
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java?view=diff&rev=534978&r1=534977&r2=534978
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/source/util/SourceUtil.java Thu May  3 12:58:52 2007
@@ -37,7 +37,7 @@
 import org.apache.excalibur.source.SourceNotFoundException;
 import org.apache.excalibur.source.SourceParameters;
 import org.apache.excalibur.source.SourceResolver;
-import org.apache.excalibur.xml.sax.SAXParser;
+import org.apache.cocoon.core.xml.SAXParser;
 import org.apache.excalibur.xml.sax.XMLizable;
 import org.apache.excalibur.xmlizer.XMLizer;
 import org.apache.regexp.RE;
@@ -232,10 +232,12 @@
 	    if (source instanceof XMLizable) {
 	        toSAX((XMLizable) source, handler);
 	    } else {
-	        SAXParser parser = null;
+	        org.apache.excalibur.xml.sax.SAXParser parser = null;
 	        try {
-	            parser = (SAXParser) manager.lookup(SAXParser.ROLE);
-	            parse(parser, source, handler);
+	            parser = (org.apache.excalibur.xml.sax.SAXParser) manager.lookup(org.apache.excalibur.xml.sax.SAXParser.ROLE);
+	            parser.parse(getInputSource(source), handler);
+	        } catch (SourceException e) {
+	        	throw SourceUtil.handle(e);
 	        } catch (ServiceException e) {
 	            throw new ProcessingException("Exception during parsing source.", e);
 	        } finally {