XSD: Allow elements from different namespace anywhere in a sequence

前端 未结 1 1845
野性不改
野性不改 2021-01-20 02:23

I\'ve been trying out the following. I want to create an XSD for an XML where certain elements are allowed to appear only once and need to be valid, and elements from other

相关标签:
1条回答
  • 2021-01-20 02:55

    In XSD 1.1 you can do this very easily by defining an open content model:

    <xs:complexType ...>
      <xs:openContent mode="interleave">
        <xs:any namespace=.../>
      </xs:openContent>
      ... regular content model ...
    </xs:complexType>
    

    There's no easy way to do it in 1.0; you just have to put an optional wildcard in every possible position.

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