You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ross Inglis <ri...@telemedia.co.uk> on 2000/07/13 09:59:25 UTC

Problem with Cocoon 1.7.4 (2nd attempt)

Hi all.

I've just installed Cocoon 1.7.4 over an existing 1.6.1 version.  I'm using
it to process
XML to HTML for some internal documentation.

Since the upgrade, many of my documents fail to display.  I get ...

Error found handling the request.
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:834)
 at org.apache.cocoon.parser.XercesParser.parse(XercesParser.java:84)
 at org.apache.cocoon.parser.AbstractParser.parse(AbstractParser.java:83)
 at
org.apache.cocoon.producer.ProducerFromFile.getDocument(ProducerFromFile.jav
a:78)
 at org.apache.cocoon.Engine.handle(Engine.java:289)
 at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
 at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
 at org.apache.jserv.JServConnection.run(JServConnection.java:188)
 at java.lang.Thread.run(Thread.java:484)

... and a hung file descriptor (I have to shut down Apache/Cocoon to close
the
document file).

I have isolated the problem to internal document entities. Any document of
the form:
=====================================================
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="stylesheet.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<!-- Define some often used entities -->
<!DOCTYPE Document SYSTEM "Doc.dtd" [
 <!ENTITY CrossRef '<emph><slink tag="tag" ref="ref"/></emph>'>
]>

<Document>
<page>
<section>
 <p>
  &CrossRef;
 </p>
</section>
</page>
</Document>
=====================================================

Blows up when the entity is referenced (&CrossRef;).

I have worked around the problem with some global search and replace passes.

Has anyone else seen this. It appears to be a problem in Xerces.

Ross.