Of course you now want to know why I do this.
Well all this has to be fast.
With a "proper" EntityResolver using a dtd one turn takes about 10 times longer
than with the "empty resolver". Don't know why but that's how it is.
So you have an XML document, but it also includes some non-XML entities which require a DTD to describe them? Then yes, the easiest way to deal with this is to make sure the parser knows where the DTD is, so that it expands the entities into XML characters properly. That in fact is how you tell the parser to "treat them as ordinary text".
The next easiest way is to attach an EntityResolver which expands those entities. It appears that you have tried that and it works.
Or is your problem that after the parser does its work, you don't know that some text node was actually an expanded entity? There's no reason why you should care about that, is there?
Joined: Apr 05, 2010
Thanks for your reply.
The problem is solved now.
The root element of the parsed XML file did not contain any xml namespace
and also no doctype, which seemed to cause the problem with the entities
while everything else worked fine.
Now I added the namespace and the doctype and the entities are still not recognized,
but now, unlike before, the callback #skippedEntity(String name) is called
with those entities whereupon I can react accordingly.