cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Aston" <>
Subject Possible Entity Resolving Bug
Date Sun, 08 Sep 2002 02:52:29 GMT

I have been doing some work with entity catlogs and have noticed some
interesting behaviour.  It appears system ids are being ignored if used with
a DOCTYPE declaration, only public ids are picked up.  I can successfully
map something like:

<!DOCTYPE person PUBLIC "-//PIGBITE//DTD Person V1.0//EN"
<> ">

using an entry like

PUBLIC "-//PIGBITE//DTD Person V1.0//EN" "dtd/person.dtd"


<!DOCTYPE person "
<> ">

does not get mapped even if 

<> " "dtd/person.dtd"

is in the local catalog.

I've noted that if a systemId is used to reference an entity - e.g. 

<> ">

and a corresponding map is in the catalog file:

<> "    "jez.txt"

then this is resolved correctly.

This does not appear to be a fundamental catalog problem.  I modified the
entity catalog tests to test the above scenarios and everything worked.
Interestingly the tests force the public Id and systemId args in the
resolveEntity() method call, however further checks what gets passed to
resolveEntity in org.apache.cocoon.components.resolver.ResolverImpl show
that in the case of DOCTYPE the systemId arg is always NULL, regardless of
if a systemId is present either on it's own or along with a publicid.  In
the case of an ENTITY declaration the systemid and the publicid (if present)
are always passed correctly.  It would appear that which ever bit of the doc
parser picks up the entity references, it is not doing it as I would have

The catalog samples work fine, mainly because all the examples follow the
above rules.  I know the local catalog is being loaded and have tested that
using the xml-commons tools, my modified cocoon test build and the fact that
the resolution does take place if the "right" rules are followed.  Trawling
the lists I noted a previous message along similar lines that had no
response, and I could not find anything else.  Is this behaviour correct or
is it a bug?  I've looked at several other sites, including the OASIS spec
and nothing seems to shed any light on it (other than implying that it
should work as expected) so If someone can advise I can either stop trying
something that is not meant to happen or raise a bugzilla and do some more

FYI I am using 2.0.3, JDK1.4, JAXP.  I have not yet tried it against the
current HEAD code or using the XML catalog format (although I am sure the
catalog itself is fine)



View raw message