August 2003
Intermediate to advanced
624 pages
15h 3m
English
JAXP performs validation in the DocumentBuilder's parse method. There is no special “validate” method as such. We tell JAXP that we want validation by specifying the type of DocumentBuilder the DocumentBuilderFactory should make. This is kind of like knowing that you want to build a barbecue out of titanium instead of stainless steel and calling the toolmaker to have him make tools to work with the former rather than the latter.
So, what options do we want to set on the DocumentBuilderFactory? Aside from the obvious one of telling it we want to validate, there are a few others. Here's the relevant code added to XMLToCSVBasic.java.
// Set up DOM XML environment DocumentBuilderFactory ... |