XML Schema to validate XML Schemas?

夙愿已清 提交于 2020-01-09 05:26:10

问题


Does anyone know if its possible to validate an XML schema with another XML schema? If so, is there a reference implementation out there? I would like to parse a Schema doc using JAXB.


回答1:


Of course. Most of the time you can just point your browser to the URL that serves as the namespace for the XML document. This also works with XML Schema: http://www.w3.org/2001/XMLSchema

The XSD is linked from there.




回答2:


Also check XSOM. This is what JAXB RI uses to load and process XSDs.




回答3:


There are two versions of the XML Schema Definition Language (XSD): 1.0 and 1.1. Version 1.0 was released in 2001 and version 1.1 was released in 2009.

The normative XSD schemas are:

  • http://www.w3.org/2001/XMLSchema.xsd
  • http://www.w3.org/2009/XMLSchema/XMLSchema.xsd

You can test the validation of an XSD schema via the command line, e.g.:

$ xmllint -noout -schema XMLSchema.xsd myschema.xsd


来源:https://stackoverflow.com/questions/3996743/xml-schema-to-validate-xml-schemas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!