开发者

How to specify unlimited children in a DTD?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜