如何在没有严格元素顺序的情况下定义DTD? [英] How to define DTD without strict element order?

查看:80
本文介绍了如何在没有严格元素顺序的情况下定义DTD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为XML菜鸟,我发现了在创建针对DTD进行验证的XML流/文件时元素顺序的重要性。是否可以定义不依赖于元素的DTD?如果需要,请提供语法示例。

As an XML "noob" I have discovered the importance of element order when creating an XML stream/file that is validated against a DTD. Is it possible to define a DTD that is not order dependent on elements ? If, so please provide syntactic example.

推荐答案

您使用(垂直管道)和 repeat (星号:)

You use or (a vertical pipe) and repeat (an asterisk:)

<!ELEMENT eltype1 ( eltype2 | eltype3)*>

这意味着 eltype1 可以包含任意数量的 eltype2 eltype3 的重复。

This means eltype1 can contain any number of repetitions of eltype2 or eltype3.

这篇关于如何在没有严格元素顺序的情况下定义DTD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆