XSD:在扩展的情况下使用##other 命名空间引用通配符的命名空间 [英] XSD: reference namespace of wildcard with ##other namespace in the case of an extension

查看:26
本文介绍了XSD:在扩展的情况下使用##other 命名空间引用通配符的命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have an XSD schema with target namespace "ns1" which defines the following type:

<xs:complexType name="type1">
  <xs:sequence>
    <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
  </xs:sequence>
</xs:complexType>

现在另一个目标命名空间为ns2"的 XSD 模式使用这种类型:

Now another XSD schema with target namespace "ns2" uses this type like this:

<xs:complexType name="type2">
  <xs:complexContent>
    <xs:extension base="ns1:type1"/>
  </xs:complexContent>
</xs:complexType>

##other 被定义为任何格式良好的 XML,它来自除所定义类型的目标命名空间之外的命名空间(不允许使用非限定元素)"(参见).

##other is defined as "Any well-formed XML that is from a namespace other than the target namespace of the type being defined (unqualified elements are not allowed)" (see).

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

Will the <any> wildcard in "type2" (inherited from "type1") use "ns2" or "ns1" as excluded namespace?

推荐答案

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

The ##other will always be in the context defined by schema ns1, i.e. ns1 is the excluded namespace.

这篇关于XSD:在扩展的情况下使用##other 命名空间引用通配符的命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆