You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ross Burton <ro...@mail.com> on 2000/04/21 16:52:57 UTC

[C2] DOMBuilder

Hi,

The discussion recently about "does DOMBuilder work" was rather apt - as
about that time I found a bug in it...  I could work around it at the time
as I was concentrating on other development (ImageEncoders for Cocoon 2, en
route to {Pier now)  but I looked into it today, and found a bug in the DTD
handling.

Basically: when DOMBuilder reaches a DTD, it treats it as any other event
stream instead of handling it specially.  The SAX parser returns element
names like "[dtd]" (for the dtd) and "%shared", which the standard entitiy
resolver doesn't like.  Xerces crashes with an Illegal Character error,
called from DOMBuilder.startEntity().  I could reproduce this error any time
by giving putting a SVG document with a DTD through SVGSerializer.

I'm not a SAX guru, so can anybody who is try to fix this bug?

Regards,
Ross Burton


Re: [C2] DOMBuilder

Posted by "Pier P. Fumagalli" <pi...@apache.org>.
Ross Burton wrote:
> 
> Hi,
> 
> The discussion recently about "does DOMBuilder work" was rather apt - as
> about that time I found a bug in it...  I could work around it at the time
> as I was concentrating on other development (ImageEncoders for Cocoon 2, en
> route to {Pier now)  but I looked into it today, and found a bug in the DTD
> handling.

Got them... :)

> Basically: when DOMBuilder reaches a DTD, it treats it as any other event
> stream instead of handling it specially.  The SAX parser returns element
> names like "[dtd]" (for the dtd) and "%shared", which the standard entitiy
> resolver doesn't like.  Xerces crashes with an Illegal Character error,
> called from DOMBuilder.startEntity().  I could reproduce this error any time
> by giving putting a SVG document with a DTD through SVGSerializer.
> 
> I'm not a SAX guru, so can anybody who is try to fix this bug?

Awww.... Got it... To build the DTD, all events between startDTD() and
endDTD() must be ignored... It should be fairly trivial to check in any
method call if the status is DTD...

	Pier

-- 
----------------------------------------------------------------------
pier: stable structure erected over water to allow docking of seacraft
<ma...@betaversion.org>      <http://www.betaversion.org/~pier/>
----------------------------------------------------------------------