• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disable XML validation in java 5  RSS feed

 
Maciej Miklas
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

How can I disable XML validation in java 5 parser? It simply does not work...


This is my code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setAttribute("http://xml.org/sax/features/validation",Boolean.FALSE); factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd",Boolean.FALSE);
DocumentBuilder builder = factory.newDocumentBuilder();


Thanks,
Maciej
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!