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);
SAXParser parser = factory.newSAXParser();
parser.setProperty( "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
parser.setProperty( "http://java.sun.com/xml/jaxp/properties/schemaSource",
"file:test.xsd");
SAXReader reader = new SAXReader( parser.getXMLReader());
Document doc = reader.read( new InputSource( "file:test.xml"));
Regards,
Edwin
http://www.edankert.com/
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
dom4j-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dom4j-user