Forums Register Login

Non validating XML parser

+Pie Number of slices to send: Send
I use xpath to parse web.xml. However I noticed that if some validation source isn't available or fails, then my parsing fails as well. For example:

Is any way to turn off validation features of XML parser and ignore all schemas?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
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
https://gardener-gift.com


reply
reply
This thread has been viewed 2091 times.
Similar Threads
TOMCAT 5.5.4 + Datasource in ROOT not working
Problem with deployment descriptor
scripting-invalid question
Unable to use El in custom tags
complete web.xml ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:29:03.