Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

building error when validating against schema using jdom

 
weishan zhang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jdom and xerces to validate xml against a schema. Here is the code list:
SAXBuilder saxbuilder =new SAXBuilder("org.apache.xerces.parsers.SAXParser", true);
//saxbuilder.setFactory(XVCLBuilderFactory.createFactory());
saxbuilder.setFactory(XVCLBuilderFactory.createFactory());
saxbuilder.setFeature("http://apache.org/xml/features/validation/schema", true);
saxbuilder.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation",
"file:///C:/test/test.xsd");
try
{
return saxbuilder.build(url);
}
catch(JDOMException jdomE)
{
System.err.println(jdomE.getCause().getMessage()); }
This is what the FAQ suggested. But I always get the building error message.
Anyone met such problem?
Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic