Can I have one XML Schema (XSD) include another XML-Schema?

前端 未结 2 492
轮回少年
轮回少年 2020-12-14 06:08

I currently have two XSD schemes and one is a \"light\" version of the other. Right now I have everything in the \"light\" version repeated in the \"complete\" schema, but t

相关标签:
2条回答
  • 2020-12-14 06:58

    Use the <include> element, see for example here.

    0 讨论(0)
  • 2020-12-14 07:02

    There are two methods for this.

    <xsd:include schemaLocation="pathToFile" /> should be used for including files of the same namespace.

    <xsd:import namespace="namespace" schemaLocation="pathToFile" /> should be used for include files in a different namespace. Usually you will specify the namespace given as the targetNamespace of the imported schema.

    0 讨论(0)
提交回复
热议问题