解组到POJO时对XSD架构的JiBX验证

时间:2012-03-27 17:21:16

标签: xml xsd unmarshalling jibx

我无法在网上找到任何解释如何在解组阶段针对现有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的示例。

0 个答案:

没有答案