Java, xml, XSLT: Prevent DTD-Validation

前端 未结 5 1337
醉酒成梦
醉酒成梦 2020-12-16 06:28

I use the Java (6) XML-Api to apply a xslt transformation on a html-document from the web. This document is wellformed xhtml and so contains a valid DTD-Spec (

5条回答
  •  悲&欢浪女
    2020-12-16 06:52

    if you use

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    

    you can try disable the dtd validation with the fllowing code:

     dbf.setValidating(false);
    

提交回复
热议问题