是否有用于解析 XSD 模式文件的 Java API?
Is there a Java API to parse an XSD schema file?
我找到了XSOM,但它似乎不再维护了.
I found XSOM, but it doesn't seem to be maintained anymore.
使用标准 JDK 6:
Using standard JDK 6:
System.setProperty(DOMImplementationRegistry.PROPERTY, "com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl");
DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
com.sun.org.apache.xerces.internal.impl.xs.XSImplementationImpl impl = (XSImplementationImpl) registry.getDOMImplementation("XS-Loader");
XSLoader schemaLoader = impl.createXSLoader(null);
XSModel model = schemaLoader.loadURI("src/test/resources/my.xsd");
这篇关于用于解析 XSD 模式文件的 Java API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!