xml 的最后一行呢,相应的 dtd 应该是什么

发布于 2024-12-01 22:40:01 字数 194 浏览 3 评论 0原文

XML文件

根名称college.it有两个子节点principal和teacher.i为此编写了相应的dtd,但是如果没有附加任何元素的单个文本行呢?如何编写相应的dtd该行是:

 This college is ranked 7th in the university

XML file

root name college.it has two child nodes principal and teacher.i wrote a corresponding dtd for that but what about a single a text line with no element attach to it.how to write a corresponding dtd line for that.the line is:

 This college is ranked 7th in the university

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2024-12-08 22:40:01

如果元素可以包含文本内容(空白除外),则它必须使用混合内容模型。例如:

<!ELEMENT college (#PCDATA | principal | teacher)*>

混合内容模型不允许您添加任何进一步的限制。例如,您不能要求 principal 仅使用一次或位于 teacher 之前。

通常,混合内容用于类似文档的半结构化数据。将这些额外信息放入 元素中可能会更好吗?

If an element can contain text content (other than whitespace) it must use the Mixed content model. eg.:

<!ELEMENT college (#PCDATA | principal | teacher)*>

The Mixed content model doesn't allow you to add any further restrictions. For example you can't require that principal is used only once or comes before teacher.

Normally Mixed content is used for document-like semi-structured data. Might it be better to kick that extra information into a <ranking> element?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文