You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Mauro Talevi <ma...@aquilonia.org> on 2003/05/22 10:16:17 UTC
Re: EntityResolver code+DTD issues
Ceki,
on a related point:
DOMConfigurator has a
doConfigure( Element, LoggerRepository )
method, but if you parse the Element using a JAXP parser ( say xerces )
without specifying the EntityResolver and pass it to the method it will
complain about not finding the dtd (I'm using JDK1.4)
It on the other hand one specifies the Log4jEntityResolver as the
EntityResolver in the DocumentBuilder (as is done in the
doConfigure ( InputSource, LoggerRepository ) method) and passes the
parsed Element to the doConfigure( Element, LoggerRepository ) method
then it works fine.
Since the EntityResolver cannot be specified in the Element, I would
suggest adding a new method
doConfigure( Element, EntityResolver, LoggerRepository)
(and an equivalent static method perhaps)
that checks that the EntityResolver is the the correct one.
It would clearly suggest to the user that the EntityResolver - the same
one that the was specified in the DocumentBuilder - is needed.
If null is passed a warning should be outputted.
I would then make doConfigure( Element, LoggerRepository) use this new
method with null EntityResolver.
Have I overlooked something or is there a simpler way to use the
configurator via an Element?
Cheers, Mauro
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org