XSD:在扩展的情况下,带有##other命名空间的通配符的引用命名空间

fly*_*lyx 5 xsd

我有一个带有目标命名空间“ns1”的 XSD 架构,它定义了以下类型:

<xs:complexType name="type1">
  <xs:sequence>
    <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
  </xs:sequence>
</xs:complexType>
Run Code Online (Sandbox Code Playgroud)

现在另一个具有目标名称空间“ns2”的 XSD 模式使用此类型,如下所示:

<xs:complexType name="type2">
  <xs:complexContent>
    <xs:extension base="ns1:type1"/>
  </xs:complexContent>
</xs:complexType>
Run Code Online (Sandbox Code Playgroud)

##other定义为“来自所定义类型的目标命名空间以外的命名空间的任何格式良好的 XML(不允许使用不合格的元素)”(请参阅​​ 参考资料)。

<any>“type2”(继承自“type1”)中的通配符是否会使用“ns2”或“ns1”作为排除的命名空间?

Pet*_*dea 2

##other 将始终位于模式 ns1 定义的上下文中,即 ns1 是排除的命名空间。