DTD 定义具有相同孩子的两个孩子
我在 dtd 中定义了三个具有相同子元素名称的元素。正确的语法是什么:
- 对于具有相同定义的所有子
- 元素,具有不同的子元素定义
示例想法:这有效吗?
<!ELEMENT one ( childone?, childtwo? ) >
<!ELEMENT two ( childone?, childtwo? ) >
<!ELEMENT three ( childone?, childtwo? ) >
<!ELEMENT childone ( #PCDATA ) >
<!ELEMENT childtwo ( #PCDATA ) >
我感谢你的帮助!多谢!
I got three elements defined in a dtd which have the same child element names. What is the correct syntax for:
- for all children having the same definition
- elements having different children definitions
Example idea: is this valid?
<!ELEMENT one ( childone?, childtwo? ) >
<!ELEMENT two ( childone?, childtwo? ) >
<!ELEMENT three ( childone?, childtwo? ) >
<!ELEMENT childone ( #PCDATA ) >
<!ELEMENT childtwo ( #PCDATA ) >
I appreciate your help! Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您的示例想法对于您的第一个场景是有效的(对于具有相同定义的所有孩子)。
您的第二种情况(元素具有不同的子定义)是不可能的。每个元素只能有一个声明。您必须声明具有唯一名称的新元素。
Yes, your example idea is valid for your first scenario (for all children having the same definition).
Your second scenario (elements having different children definitions) isn't possible. You're only allowed to have one declaration per element. You would have to declare new elements with unique names.