Felix Meschberger wrote:
Am Mittwoch, den 16.01.2008, 17:01 +0100 schrieb Thomas Mueller:
Hi,
My experience is that all XML parser are a little bit different. I
don't know about you, but I did run into quite many problems because
of XML parser incompatibilities. If we always use the same parser we
would be sure we always get the same result on all systems. I believe
that would be a big advantage, what do you think?
Definitely +1, esp. since using JAXP you can never be sure, which parser
you actually get and end up trying to workaround bugs of all venues ...
We suffered from this problem in Cocoon for years - although we felt
that using JAXP was the way to go. So we created a lot of workarounds
for various bugs in the different implementations - which obviously is
rather ugly.
Then we decided to require a specific version of the parser which is as
bug free as possible. So users had to put it up into the hell of
lib/endorsed - and of course this created a bunch of other problems
(users forgot about it or were not allowed etc.).
So the final solution is to ensure to use the right version without
relying on others (being it users or the jdk). The only way of achieving
this however is to have an own classloader...so, although we are
speaking of a webapp, the webapp creates its own classloader which loads
acts classes from WEB-INF/classes and WEB-INF/lib *before* the parent
classloader. Then you can put the JAXP impl into WEB-INF/lib and are done.
Ok, heavy solution for such a problem.
But it even gets better :) (stranger?): We also developed a maven plugin
that created this classloader during development: every servlet, filter,
listener etc. declared in web.xml gets wrapped by an own implementation
using the custom classloader. So the whole thing is transparent (and
therefore even more scary).
Just to give another option/opinion.
Carsten
--
Carsten Ziegeler
[EMAIL PROTECTED]