Is there documentation that explains how to validate using xerces?
Here's what I've tried:
private Document validateXMLInstance(String xmlString) throws SAXException, IOException
{
InputSource inputSource = new InputSource(new StringReader(xmlString));
// to resolve relative reference to dtd
inputSource.setSystemId("file:/DTDs/Job.dtd");
DOMParser DP = new DOMParser();
DP.parse(inputSource);
Document document = DP.getDocument();
RevalidatingDOMParser rDP = new RevalidatingDOMParser();
if(rDP.validate(document.getDocumentElement()) == null)
return document;
else
return null;
}


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



Reply via email to