cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <>
Subject Re: Resolution/validation woes
Date Wed, 02 Jan 2002 22:02:43 GMT
Berin Loritsch wrote:

>> I always try to avoid validation, but this time I have to: while 
>> playing with a pretty cool DocBook add-on for M$ Word (you might want 
>> to check it out at it's closed-source yet it 
>> has a free that does all that is needed to me) I'm facing the fact 
>> that the software saves its documents with a
>> <!DOCTYPE article SYSTEM "sdocbook.dtd">
>> directive. This caused my Cocoon to fail with a 
>> ResourceNotFoundException on the missing DTD file.

> This has nothing to do with Validation, or a Cocoon setting.  This has
> everything to do with Xerces, or whatever your parser is.  The fact is
> that Xerces will read the DTD if the DocType header is placed in the
> document everytime.  It does this for entity resolution in your documents.

OK, that's exactly what I knew. But I also thought that the parser was 
not meant to choke and give up parsing if (in non-validating mode) the 
DTD could not be found. This is the behaviour I expect and that I 
strongly recall I encountered before, am I that wrong?

> If you choose not to perform validation (the default), the DTD is still
> read, although only the entity declarations are used.  Now, there *might*
> be something in the way we create Parser objects that we need to change
> so that they use the EntityResolver (i.e. catalog) for us.

That might help.

> If you want to completely ignore all DTD/Schema directives, do not supply
> a DocType header!

OK, now we have a chicken and egg problem. I would gladly use a 
stylesheet to strip the DTD part using the xsl:copy-of trick, but 
actually I can't because my document isn't parsed so it cannot be 
transformed :) This sounds pretty weird to me, I'm not going to resort 
to String.replace() for this. I have to find a way out, and I strongly 
suspect that I'm not the only one...

I'll check out the docs (actually I already had a look at the Xerces 
FAQs, and it seems that the only occasion when an error is thrown is 
with a DTD declared but not found in validating mode). Thanks for now.



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

View raw message