Forums Register Login

schema validator

+Pie Number of slices to send: Send
public boolean validate(String xmlPath, String schemaPath,Category inCat,ParameterObject pobj) throws Exception{

try {

DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemaPath);
ErrorHandlerInterface er=new ErrorHandlerInterface( inCat,pobj);
parser.setErrorHandler((ErrorHandler) er);
DQMLogger.logInfo("Schema validation applying schema to "+xmlPath+" using "+schemaPath,inCat);
parser.parse(xmlPath);
return er.isValid();
}
catch (Exception e){
return false;

}

}


i have written a schema validator which doesnt work properly. this is the code . anybody help? any alternatives?
Talk sense to a fool and he calls you foolish. -Euripides A foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 869 times.
Similar Threads
XML schema validation problem
Validate xml against schema
schema validator
xml validator problem
from jaxp program how to get schema/dtd name present in xml
More...

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