开发者

How to specify unlimited children in a DTD?

开发者 https://www.devze.com 2023-03-20 14:33 出处:网络
I have a root tag <alphabet> which can have an 开发者_高级运维unlimited (but optional) number of tags <a> or <b> or <c> in them.How do I specify this in a DTD?Use the * occurre

I have a root tag <alphabet> which can have an 开发者_高级运维unlimited (but optional) number of tags <a> or <b> or <c> in them. How do I specify this in a DTD?


Use the * occurrence indicator:

<!ELEMENT alphabet (a|b|c)*>

You could also use ANY if you don't know what children alphabet will have:

<!ELEMENT alphabet ANY>

Note that whatever elements (tags) that appear inside of alphabet still need to be declared. See my answer here for an example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号