cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Painter-Wakefield" <>
Subject Re: Exception thrown at XML with DTD
Date Fri, 15 Aug 2003 15:46:51 GMT

I don't think turning off validation will do any good.  The DTD could
contain definitions for entities in your document (e.g., nbsp), so the
parser pretty much has to have the DTD if it is specified in your document.

We had a similar issue.  In our case we were accessing an XML document via
Java code, then using a parser against it.  The DTD definition used a
relative path (no protocol or host info), and since the parser didn't know
where we had obtained the document, it had no way to find the DTD.  Anyway,
I don't remember all the details, but we finally just downloaded the DTD
and stored it locally, and had the CatalogManager provide the DTD.   I
don't know much about it, but apparently the CatalogManager exists for
local storage of DTDs.

I think the way to do it is:
1.  Save the DTD in your resources/entities folder (comes with the Cocoon
webapp, I think).
2.  Edit the file resources/entities/catalog with an entry for the new DTD.
3.  Edit the file for the path(s) to your
entities folder.  We have multiple entries with absolute paths accomodating
both our development machines and our server.  I'm not sure if it is still
necessary to do an absolute path, but when we set this up we couldn't get
relative paths to work.
4.  Put the someplace where it will get picked up
in your classpath, e.g., WEB-INF/classes.

This might help.


                      Jan Warnstam                                                       
                      <jan.warnstam@eur        To:      
            >              cc:     
                                               Subject:  Exception thrown at XML with DTD
                      08/15/2003 11:20                                                   
                      Please respond to                                                  

Hello list,

I am currently developing a system to transform NewsML files into news
articles suited for web presentation, and using XSLT transforms in
Cocoon 2 to do this.

The NewsML files all have a "<!DOCTYPE ..." part that seems to confuse
the Cocoon machinery - in other words it throws a
" refused". If I comment the
"<!DOCTYPE ..." part of the XML file it all works fine.

The DTD that is pointed out exists and is reachable via a normal HTTP
request in a browser.

In cocoon.xconf the parameter called "validate" is set to it's default
value, which is "false". The parser used is the default parser

I wouldn't mind turning the validation off altogether as we will have to
trust the quality of the XML files anyway, so what I want to do is get
Cocoon to not care at all about the "<!DOCTYPE ..." part of the
document, and not try to perform this validation (if it's what causes
the crash).

Does anyone have any ideas or tips? Thanks in advance.

  Jan Warnstam

  Teknikringen 1E
  583 30 Link?ping
  013-21 81 81

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message