Fair enough ...
In that case, you could use the org.dom4j.io.DocumentInputSource and do
something like this:
public void validate( Document document) throws ... {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating( true);
factory.setNamespaceAware( true);
Edwin Dankert wrote:
Normally you use the underlying parser to perform the validation.
SAXReader reader = new SAXReader( parser.getXMLReader());
Document doc = reader.read( new InputSource( "file:test.xml"));
However, OP was asking about validating a DOM *in memory*. Isn't there a way to v
Normally you use the underlying parser to perform the validation.
You could use for instance something like this to validate against a
XML Schema:
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating( true);
factory.setNamespaceAware( true);
SAXPars