As a document markup language, SGML was originally designed to enable the sharing of machine-readable large-project documents in government, law, and industry. Many such documents must remain readable for several decades—a long time in the information technology field. SGML also was extensively applied by the military, and the aerospace, technical reference, and industrial publishing industries. The advent of the XML profile has made SGML suitable for widespread application for small-scale, general-purpose use. Document validity SGML (ENR+WWW) defines two kinds of validity. According to the revised Terms and Definitions of ISO 8879 (from the public draft): A conforming SGML document must be either a type-valid SGML document, a tag-valid SGML document, or both. Note: A user may wish to enforce additional constraints on a document, such as whether a document instance is integrally-stored or free of entity references. A type-valid SGML document is defined by the standard as An SGML document in which, for each document instance, there is an associated document type declaration (DTD) to whose DTD that instance conforms. A tag-valid SGML document is defined by the standard as An SGML document, all of whose document instances are fully tagged. There need not be a document type declaration associated with any of the instances. Note: If there is a document type declaration, the instance can be parsed with or without reference to it. Terminology Tag-validity was introduced in SGML (ENR+WWW) to support XML which allows documents with no DOCTYPE declaration but which can be parsed without a grammar, or documents which have a DOCTYPE declaration that makes no XML Infoset contributions to the document. The standard calls this fully tagged. Integrally stored reflects the XML requirement that elements end in the same entity in which they started. Reference-free reflects the HTML requirement that entity references are for special characters and do not contain markup. SGML validity commentary, especially commentary that was made before 1997 or that is unaware of SGML (ENR+WWW), covers type-validity only. The SGML emphasis on validity supports the requirement for generalized markup that markup should be rigorous. (ISO 8879 A.1) Syntax An SGML document may have three parts: the SGML Declaration, the Prologue, containing a DOCTYPE declaration with the various markup declarations that together make a Document Type Definition (DTD), and the instance itself, containing one top-most element and its contents. An SGML document may be composed from many entities (discrete pieces of text). In SGML,