Ejemplo n.º 1
0
  private Document createPropertiesDocument(byte[] input) throws Exception {
    ByteArrayInputStream ba = new ByteArrayInputStream(input);
    DOMParser dp = new DOMParser();

    dp.setFeature("http://xml.org/sax/features/validation", false);
    dp.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
    dp.setFeature("http://xml.org/sax/features/namespaces", false);
    dp.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);

    dp.parse(new InputSource(ba));
    return dp.getDocument();
  }