【问题标题】:specify allowed attributes as delimited string in another attribute in XSD将允许的属性指定为 XSD 中另一个属性中的分隔字符串
【发布时间】:2012-05-04 20:50:18
【问题描述】:

我对如何设计 xml 模式感到困惑,其中元素的属性必须具有来自另一个元素的属性中列出的名称。

一个有效的例子:

<A allowedAttributeNames="attrA,attrB">

<B attrA="1" attrB="34">

一个无效的例子:

<A allowedAttributeNames="attrA,attrB">

<B attrC="72">

一般来说,认为separator-separated-lists在xsd中支持差是真的吗?

提前致谢!

【问题讨论】:

    标签: xml xsd schema xml-attribute


    【解决方案1】:

    在 XSD 1.0 中不能这样做。

    您可以在 XSD 1.1 中使用断言来做到这一点。 Xerces 和 Saxon 的最新版本目前支持 XSD 1.1。

    【讨论】:

      猜你喜欢
      • 2021-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-01
      • 2021-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多