Setting a custom XOM EntityResolver

577 views Asked by At

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?

1

There are 1 answers

0
Stefan Kendall On BEST ANSWER

Use a custom XMLReader.

XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new EntityResolver(){...});
Builder builder = new Builder( reader );