2

Smililarly to the question: XML what does that question mark mean
what does exclamation mark mean in e.g. below from Meaning of - <?xml version="1.0" encoding="utf-8"?>.?

I have not been able to find it here on stackoverflow or via web search. The link https://www.w3schools.com/xml/xml_syntax.asp from the answer the the question above on question mark mnetioned only one example of <! that is comment <!--.

<!DOCTYPE html 
 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Alexei Martianov
  • 2,839
  • 7
  • 28
  • 62

3 Answers3

2

Constructs in the XML prolog beginning with <! are called markup declarations. XML supports element declarations (<!ELEMENT ...), attribute declarations (<!ATTLIST ...), entity declarations (<ENTITY ...), and notation declarations (<!NOTATION ...). These appear within a document type declaration (<!DOCTYPE ...). The syntax of markup declarations is derived from SGML, the larger markup meta-language of which XML (and HTML syntax) is a subset. SGML has additional types of markup declarations such as short reference use/map declarations (<!USEMAP .../<!SHORTREF ...) for parsing Wiki syntax into markup, and link set declarations (<!LINK .../<!IDLINK ...) for use within link process declarations (<!LINKTYPE ...), another type of declaration set SGML has in addition to document type declarations, and which can be used to express stylesheets.

imhotap
  • 2,037
  • 1
  • 7
  • 14
1

<!DOCTYPE starts a Document Type Declaration, <!-- introduces a comment.

There exist CDATA sections, Element Type Declarations, Attribute-List Declarations, Entity Declarations, Notation Declarations, and Conditional Sections also, that all start with <!.

You can read more about them in the XML specification.

Daniel Haley
  • 49,094
  • 5
  • 67
  • 90
choroba
  • 216,930
  • 22
  • 195
  • 267
1

Consider it the generic prefix for an 'element of the XML syntax' (ad hoc term). The grammar does not assign a non-terminal to the sequence <!, it only occurs in conjunction with some other text ( eg. <!DOCTYPE, <!ELEMENT, <!-- ). Note how that differs from processing instructions generically prefixed with <?.

The authoritative reference are the W3C standards for XML (v 1.0, v 1.1).

collapsar
  • 16,200
  • 4
  • 33
  • 60
  • `non-terminal` was new (or long forgotten) term for me, I found that link https://gerardnico.com/code/compiler/nonterminal. Looks like correct meaning, if not, please correct me. – Alexei Martianov Jul 25 '19 at 07:04