【发布时间】:2016-05-10 09:03:03
【问题描述】:
我正在尝试生成有效的 xdxf 文档 (here's the DTD)。除了一个错误,我已经设法解决了所有错误,但我不知道出了什么问题。
相关部分是
...
<def>
<def>
<gr>n. s.</gr>
<deftext>
<tr>pronunciation</tr>
<dtrn>Meaning</dtrn>
</deftext>
<co>Inflected forms</co>
<ex>
<ex_orig>Examples</ex_orig>
</ex>
</def>
<def>
<gr>n. s.</gr>
<deftext>
<tr>pronunciation</tr>
<dtrn>Another meaning</dtrn>
</deftext>
<co>Inflected forms</co>
<ex>
<ex_orig>Examples</ex_orig>
</ex>
</def>
</def>
...
我得到的错误(两次,所以我猜是内部def,而不是外部)是:
元素类型“def”的内容必须匹配 "(gr?,ex*,co*,sr?,etm?,categ*,(def+|deftext))"。
that's none or one gr (ok), none or many ex (ok), none or many co (ok), none或一个 sr、etm(无)、无或多个 categ(正常)以及一个或多个 def或者恰好是一个 deftext(外部和内部 def 都可以)。我的理解是正确的还是我忽略了什么?
【问题讨论】:
标签: xml validation dtd