> >Where I came unstuck was the name parameter: > > > >name - Identifies the external entity being resolved. Either > "[dtd]" for the > >external subset, or a name starting with "%" to indicate a > parameter entity, > >or else the name of a general entity. This is never null when > invoked by a > >SAX2 parser. > > > >I haven't much of a clue how to do that. > > It looks like the specs don't take into consideration XML Schema; what > should "name" contain in that case? > If this resolver should be invoked only when a DTD entity is being > resolver, the informations is almost there; the LastExtEntityInfo > structure > needs to be extended with a "name" field, that getLastExtEntityInfo would > fill by using the XMLEntityDecl currently in scope. > > OK, that doesn't quite work:
a) The names don't look like those specified in the spec, which has % starting parameter entities and [dtd] for the dtd. b) getLastExtEntityInfo is returning information for the _previous_ element. resolveEntity() is called during the process of parsing the element, e.g. <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "xhtml-lat1.ent"> %HTMLlat1; at this point, the available name is wrong. So basically, that's the wrong information. The simplest way I could see around this is to pass the name into createReader in ReaderMgr all over the place (defaulting to NULL), and then DTDScanner.cpp gets to fill this information out at the appropriate time. Any further pointers? As an alternative way around my problem, and possibly in addition anyway, could we perhaps resolve the systemId relative to the appropriate base URI before calling resolveEntity() in the plain ER1? Basically, going back to my original problem, there isn't enough context provided giving just the unresolved entity URI and no base URI to actually figure out where to find the resource. This as far as I can tell makes the original EntityResolver essentially useless, so having thought of that, maybe the fact that this isn't done already is just a bug? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
