Both the DocumentBuilderFactory and the SAXParserFactory have setValidating(boolean) methods. However their default is "false", so I would have thought non-validating would be the default. Maybe there's some other possible reason for your failures? Or maybe you're using some other parser factory, since you say you're using XPath to parse.
Another wrinkle in this is the difference between validation and entity resolution. Even if you turn off validation, most parsers will still attempt entity resolution. You can have things fail at that point too, or at least experience some performance drag. setValidating(false) has no impact on entity resolution. With some parser APIs (e.g. SAX) you can provide your own entity resolver to basically force it to shut up. You can see an example of this by looking at the source code for Digester.
Thank you for the responses. Generally I use XPathFactory and I do not see any methods for switching validation. Here is a method as setFeature(name,bool), however I do not see where I can get lists of supported features (checked XMLConstants), and is there feature responsible for validating?
Post by:autobot
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, that will fit in a stocking