What does "- O" mean when the type of a DTD element is declared?

According to the W3C specification, an XML element is declared in the form:

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

And w3school samples:

  <!ELEMENT br EMPTY> 

But in html 4.01 strict dtd the br element is:

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

Why does the second ad add "- O" ? What does it mean? And where can I find an official document on this?

+4
source share
2 answers

A hyphen is required; option O is optional. Thus, β€œO” means that an opening tag is required, and a closing tag is optional. You can read more at & sect; 3.3.3

+3
source

As @erickson says, a hyphen means β€œrequired” and β€œO” means optional. The first is / O for the start tag, and the second is / O for the end tag. This is called tag minimization.

Tag minimization is only allowed in SGML DTML. That's why you see it in HTML Strict DTD, but you don't see it in XML Spec or XML examples in w3schools.

+2
source

Source: https://habr.com/ru/post/1379062/


All Articles