开发者

Setting a custom XOM EntityResolver

开发者 https://www.devze.com 2022-12-25 21:26 出处:网络
I need to not validate against a doctype, so I\'d like to set a cust开发者_运维知识库om EntityResolver that accepts everything. I\'m getting data back from tagsoup, so I know my data is well-formed an

I need to not validate against a doctype, so I'd like to set a cust开发者_运维知识库om 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?


Use a custom XMLReader.

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

精彩评论

暂无评论...
验证码 换一张
取 消