Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xml

dtd

sgml

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?

like image 536
btpka3 Avatar asked Nov 01 '11 02:11

btpka3


1 Answers

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

like image 151
erickson Avatar answered Sep 23 '22 21:09

erickson