【发布时间】:2011-12-11 07:20:24
【问题描述】:
我不知道如何为可以包含混合顺序的相同元素的 XML 文件编写 DTD。
显示问题的小例子如下:
<root>
<element>
<one></one>
<two></two>
</element>
<element>
<two></two>
<one></one>
</element>
<element>
<two></two>
<two></two>
<two></two>
<two></two>
<one></one>
<one></one>
</element>
</root>
我的 DTD:
<!ELEMENT root(element*)>
<!ELEMENT element((one*,two*)|(two*,one*))>
我找到了similar topic,但该解决方案在我的情况下不起作用(我目前不确定我的 DTD 有什么问题)。 我收到此错误消息:
xmllint: Content model of Instructors is not determinist: ((one* , two*) | (two* , one*))
【问题讨论】:
-
在 XMLSpy 中,DTD 和 XML 文件是有效的。也许是 xmllint 中的错误?