开发者

XML DTD - What does the asterisk mean when it's outside the bracket

开发者 https://www.devze.com 2023-04-08 15:43 出处:网络
I understand that <!ELEMENT tagname (source*)> means that source can appear zero or more times, but I don\'t understand what this means

I understand that

    <!ELEMENT tagname (source*)>

means that source can appear zero or more times, but I don't understand what this means

     <!ELEMENT sto开发者_Go百科ry (#PCDATA | date)*>

Is that asterisk outside the bracket applied to everything inside or to story or something else?

Thanks!


It's a (possibly empty) sequence over { #PCDATA | date }. To be clear a production rule for (x|y)* is

(x|y)* = {} | x(x|y)* | y(x|y)*

In your language of "zero or more times" it means that you repeatedly choose one of #PCDATA or date where you make zero or more choices.

Clear?

0

精彩评论

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