【发布时间】:2012-03-27 17:21:15
【问题描述】:
我在网上找不到任何解释如何在解组阶段根据现有 XSD 架构验证 XML 的示例。
目前我有哪个工作正常:
IBindingFactory bfact = BindingDirectory
.getFactory(aClass.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
return (aClass) uctx.unmarshalDocument(new FileInputStream(
fname), null);
} catch (FileNotFoundException e) {
throw new IOException(e);
} catch (JiBXException e) {
throw new IOException(e);
}
但是在这个过程中,我可以告诉 Jibx 在解组到对象之前根据模式验证 XML 吗? JiBX 甚至可以吗?我看到了使用 JaxB 的示例,但没有看到使用 JibX 的示例。
【问题讨论】:
标签: xml xsd unmarshalling jibx