xerces avoid check remote dtd

 private final static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      private final static TransformerFactory transformerFactory = TransformerFactory.newInstance();
  
     static {
         documentBuilderFactory.setValidating(false);
         try {
             documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
         } catch (Exception e) {
             e.printStackTrace();
             throw new RuntimeException("Exception disabling 'http://apache.org/xml/features/nonvalidating/load-external-dtd'", e);
         }
 
     }

你可能感兴趣的:(xerces avoid check remote dtd)