0

鉴于:

<!ELEMENT diagnostic-tracks (hookup*, (%step;)*, ((diagnostic-track-automated, diagnostic-track-manual) | diagnostic-track-automated | diagnostic-track-manual), evaluate*, disconnect*)>

<!ELEMENT diagnostic-track-automated (((%step;) | diagnostic_group)*, diagnostic_group, evaluate*)>

<!ENTITY % step "((%figtab;) | step1 | step1-alt)">
<!ENTITY % figtab "figure | figure-alt | table | table-alt | lubetab">

我收到了非确定性内容模型错误,诊断跟踪自动化和诊断组可以同时匹配两个或多个令牌。

我改为:

<!ELEMENT diagnostic-tracks (hookup*, (%step;)*, diagnostic-track-automated?, diagnostic-track-manual?, evaluate*, disconnect*)>

<!ELEMENT diagnostic-track-automated (((%step;) | diagnostic_group+)*, evaluate*)>

这消除了错误消息,但我不认为我的更改,尤其是对于diagnostic-track-automated,是正确的。

我感谢任何改进建议。

4

1 回答 1

1

我认为你想出的diagnostic-tracks似乎是你试图用原始的非确定性模型完成的:

零个或多个hookup元素后跟
零个或多个元素 from%step;后跟
零个或一个 diagnostic-track-automated元素后跟
零个或一个 diagnostic-track-manual元素后跟
零个或多个 disconnect元素

但是我认为修复diagnostic-track-automated不是您最初想要的。

你现在提议的是:

零个或多个元素来自%step;diagnostic_group后跟
零个或多个evaluate元素

我认为你的意思是:

零个或多个元素 from%step;后跟
一个或多个 diagnostic_group元素,后跟
零个或多个evaluate 元素

这将是:

<!ELEMENT diagnostic-track-automated ((%step;)*, diagnostic_group+, evaluate*)>

这是一个完整/可测试的例子......

DTD (so.dtd)

<!ENTITY % figtab "figure | figure-alt | table | table-alt | lubetab">
<!ENTITY % step "%figtab; | step1 | step1-alt">

<!ELEMENT diagnostic-tracks (hookup*, (%step;)*, diagnostic-track-automated?, diagnostic-track-manual?, evaluate*, disconnect*)>

<!ELEMENT diagnostic-track-automated ((%step;)*, diagnostic_group+, evaluate*)>

<!ELEMENT table EMPTY>
<!ELEMENT table-alt EMPTY>
<!ELEMENT diagnostic_group EMPTY>
<!ELEMENT step1-alt EMPTY>
<!ELEMENT evaluate EMPTY>
<!ELEMENT figure EMPTY>
<!ELEMENT figure-alt EMPTY>
<!ELEMENT lubetab EMPTY>
<!ELEMENT step1 EMPTY>
<!ELEMENT diagnostic-track-manual EMPTY>
<!ELEMENT disconnect EMPTY>
<!ELEMENT hookup EMPTY>

XML

<!DOCTYPE diagnostic-tracks SYSTEM "so.dtd">
<diagnostic-tracks>
    <diagnostic-track-automated>
        <diagnostic_group/>
    </diagnostic-track-automated>
    <diagnostic-track-manual/>
</diagnostic-tracks>
于 2020-02-28T20:44:29.497 回答