This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Product and Other Certifications and the fly likes schema validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "schema validator" Watch "schema validator" New topic
Author

schema validator

n.chenththuran
Ranch Hand

Joined: Jun 16, 2004
Posts: 41
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: schema validator
 
Similar Threads
from jaxp program how to get schema/dtd name present in xml
xml validator problem
XML schema validation problem
Validate xml against schema
schema validator