XML 模式唯一粒子属性约束

发布于 2024-10-03 02:38:23 字数 1913 浏览 1 评论 0原文

有谁知道 xml 模式中所谓的“唯一粒子属性”约束以及为什么它可能会被违反:

  <xs:complexType name="SMIL.switch.content">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="smil:metadata"/>
        <xs:element ref="SMIL.switch-control"/>
      </xs:choice>
      <xs:choice>
        <xs:choice>
          <xs:sequence maxOccurs="unbounded">
            <xs:choice maxOccurs="unbounded">
              <xs:element ref="SMIL.timecontainer.class"/>
              <xs:element ref="SMIL.media-object"/>
            </xs:choice>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="smil:metadata"/>
              <xs:element ref="SMIL.switch-control"/>
            </xs:choice>
          </xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="smil:metadata"/>
            <xs:element ref="SMIL.switch-control"/>
          </xs:choice>
        </xs:choice>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="smil:layout"/>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="smil:metadata"/>
            <xs:element ref="SMIL.switch-control"/>
          </xs:choice>
        </xs:sequence>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

运行 XJC 的错误如下:

[错误] cos-nonambig:“http://www.w3.org/ns/SMIL< /a>":元数据和"http://www.w3.org/ns/SMIL ":元数据(或元素 来自他们的替换组)违反了“唯一粒子归因”。在针对此模式进行验证期间,存在歧义 将为这两个粒子创建。

该模式是使用 trang 从 SMIL 3.0 DTD 生成的。

Does anyone know anything about the so called "Unique Particle Attribution" constraint in xml schema and why it might be violated by this:

  <xs:complexType name="SMIL.switch.content">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="smil:metadata"/>
        <xs:element ref="SMIL.switch-control"/>
      </xs:choice>
      <xs:choice>
        <xs:choice>
          <xs:sequence maxOccurs="unbounded">
            <xs:choice maxOccurs="unbounded">
              <xs:element ref="SMIL.timecontainer.class"/>
              <xs:element ref="SMIL.media-object"/>
            </xs:choice>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="smil:metadata"/>
              <xs:element ref="SMIL.switch-control"/>
            </xs:choice>
          </xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="smil:metadata"/>
            <xs:element ref="SMIL.switch-control"/>
          </xs:choice>
        </xs:choice>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="smil:layout"/>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="smil:metadata"/>
            <xs:element ref="SMIL.switch-control"/>
          </xs:choice>
        </xs:sequence>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>

The error from running XJC is as follows:

[ERROR] cos-nonambig: "http://www.w3.org/ns/SMIL":metadata and "http://www.w3.org/ns/SMIL":metadata (or elements
from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity
would be created for those two particles.

The schema is generated from the SMIL 3.0 DTD using trang.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬シ愛 2024-10-10 02:38:23

如果验证遇到 smil:metadata 元素,它无法知道它是否与外部序列的第一个选择部分或第二个选择部分匹配。 XML Schema 不允许这种歧义。

请参阅 XML 模式建议书第 1 部分的附录 H。

If validation would encounter a smil:metadata element, it cannot know whether this matches the first choice part or the second choice part of the outer sequence. And XML Schema does not allow this ambiguity.

See appendix H of the XML Schema Recommendation, part 1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文