How can I disable XML validation in java 5 parser? It simply does not work...
This is my code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
I assume you're talking about XML Schema validation. If it's well-formedness checks you want to disable, then how should the parser deliver a valid Document object?
Disabling schema validation should be easy, as enabling it usually takes some effort.
Why do you think your code is validating? Does builder.isValidating() return true, do you get Schema validation errors, which Exception is thrown by the parser?
it connects to the internet for dtd.
On my server there is no internet connection, so it waist for timeout - like 10 seconds. If I remove the dtd part from xml, the parsing is very fast.
I need to keep dtd part in xml, but I do not want it to be validated.