XML模式密钥对,引用

时间:2015-07-08 11:06:09

标签: xml xsd schema

如何编写xsd模式,它会检查xml中对某个元素的引用是否有效?

如果“样式”中不存在“redbox”样式,则Schema应标记错误。 代码:

  <styles>
    <style name="www" color="#f0ff00" text-transform="uppercase"/>
    <style name="redbox" background-color="#ff0000" border="1"/>
  </styles>

现在我想要make引用在我的新元素中使用预定义属性。

<div style="redbox" position="20 50 500 0" />

'解码'之后,这个div对象看起来像

<div background-color="#ff0000" border="1" position="20 50 500 0" />

0 个答案:

没有答案
相关问题