EntityResolver : can it be determined through a system property ?
posted 10 years ago
I'm trying to set a customized EntityResolver (telling the xml parser where to look for XML schema files). Usually, you'd use the standard syntax - somehting like: SaxParser parser=new SaxParser(); parser.parser.setEntityResolver(myResolver);
However, I was wondering whether you can set a "global" EntityResolver, to be used as default for all parsers ? Maybe this can be done through some system property, or a static method somewhere in the parsing XML ?
(BTW, I need it because I'm using some third-party API, that encapsulates a SaxParser, but won't let me access it, so I can't configure it directly).
I don't see anything like that, but then the list of "features" and "properties" for XML parsers is basically undocumented. However, would an XML Catalog work in your context? I don't know much about them, basically all I know is that they allow you to do things like caching DTDs locally so you don't keep having to go to the Internet to get them.