Question

I need to not validate against a doctype, so I'd like to set a custom EntityResolver that accepts everything. I'm getting data back from tagsoup, so I know my data is well-formed and correct.

Furthermore, I need to rapidly hit a number of documents, so when I do this with the default EntityResolver, I get 503 from w3.org.

How, then, can I use a XOM builder with a custom entity resolver?

Was it helpful?

Solution

Use a custom XMLReader.

XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new EntityResolver(){...});
Builder builder = new Builder( reader );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top