Xml validation with schema header and Catalog lookup

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 05:10:32

Looks like it is not possible at the moment (libxml 2.8.0). This is taken from libxml page (xmlschemas):

interface to the XML Schemas handling and schema validity checking, it is incomplete right now.

As a workaround one may use a combined schema with lots of import elements. Superfluous namespaces may be specified. Finally the combined schema must be passed to the validator explicitly.

Namespaces imported with xsd:import are resolved correctly using catalogs, unless schemaLocation in import specifies valid direct location.

<import namespace="http://example.com"
          schemaLocation="example.xsd">

If example.xsd does not exist in current directory, it is resolved using catalog files.

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