Environment:
cocoon-2.0.3
jdk 1.3
tomcat 4.0.1
AIX 4.3
An action that uses an XMLFilterImpl and sets ContentHandler to a local
file
when parsing XML is failing with ArrayIndexOutOfBoundsExeption from
org.apache.xerces.parsers.AbstractSAXParser.parse(...:1193). This
action
worked for a previous version of Cocoon (2.0b2) that was bundled with
xerces 1.4.1.
So I pared back to very basic code (follows). It also gives the same
error
when compiled with xercesImpl-2.0.0.jar and xml-apis.jar. But works
with
xerces-2_0_2 (xercesImpl.jar and xmlParserAPIs.jar) and xerces 1.4.1
I want to use cocoon-2.0.3 with the xerces-2_0_2, but have been
unsuccessful. Any suggestions? I have been using the binary
distribution
for cocoon and want to avoid building it.
Thanks,
Amy
=======Code===================
import java.io.FileReader;
import java.io.FileOutputStream;
import org.xml.sax.XMLReader;
import org.xml.sax.SAXException;
import org.xml.sax.InputSource;
import org.xml.sax.ContentHandler;
import org.xml.sax.helpers.XMLReaderFactory;
import org.apache.xml.serialize.XMLSerializer;
public class mySax {
public static void main (String args[])
throws SAXException {
String pn = "org.apache.xerces.parsers.SAXParser";
XMLReader xr = XMLReaderFactory.createXMLReader(pn);
try {
FileOutputStream ff = new FileOutputStream("out.xml");
XMLSerializer xs = new XMLSerializer(ff, null);
xr.setContentHandler (xs.asContentHandler());
FileReader reader = new FileReader ("in.xml");
xr.parse (new InputSource (reader));
} catch (Exception e) {
System.out.println ("failed: " + e);
e.printStackTrace();
}
}
}
===========Traceback===================
java.lang.ArrayIndexOutOfBoundsException: -1
at java.lang.Throwable.<init>(Throwable.java:84)
at java.lang.Exception.<init>(Exception.java:35)
at org.xml.sax.SAXException.<init>(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(...:1193)
at mySax.main(mySax.java:25)
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>