Search code examples
xmldtdsgml

What is "- O" meaning when declare a DTD element type?


According W3C XML specification, element is declared in form of :

[45]    elementdecl    ::=      '<!ELEMENT' S Name S contentspec S? '>'
[46]    contentspec    ::=      'EMPTY' | 'ANY' | Mixed | children

And samples on w3school is :

 <!ELEMENT br EMPTY>

But in html 4.01 strict dtd element br is :

<!ELEMENT BR - O EMPTY                 -- forced line break -->

Why the second declaration add “- O”? What it means? And Where can I find the offical document about this?


Solution

  • The hyphen means required, the O means optional. So "- O" means that the opening tag is required, and the closing tag is optional. You can read more in §3.3.3