Well-formed document
Encyclopedia
A well-formed document in XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 is a document
Electronic document
An electronic document is any electronic media content that are intended to be used in either an electronic form or as printed output....

 that adheres to the syntax
Syntax
In linguistics, syntax is the study of the principles and rules for constructing phrases and sentences in natural languages....

 rules specified by the XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 1.0 specification in that it must satisfy both physical and logical structures."

Requirements

At its base level well-formed documents require that:
  • Content be defined.
  • Content be delimited with a beginning and end tag
  • Content be properly nested (parents within roots, children within parents)


To be a well-formed document, rules must be established about the declaration and treatment of entities. Tags
Tag (metadata)
In online computer systems terminology, a tag is a non-hierarchical keyword or term assigned to a piece of information . This kind of metadata helps describe an item and allows it to be found again by browsing or searching...

 are case sensitive
Case sensitivity
Text sometimes exhibits case sensitivity; that is, words can differ in meaning based on differing use of uppercase and lowercase letters. Words with capital letters do not always have the same meaning when written with lowercase letters....

 (ideally in lower case), with attributes delimited with quotation marks. Empty elements have rules established. Overlapping tags break invalidate a document. Ideally, a well-formed document conforms to the design goals of XML.

According to JavaCommerce.com XML tutorial, "Well formed XML documents simply markup pages with descriptive tags. You don't need to describe or explain what these tags mean. In other words a well formed XML document does not need a DTD, but is must conform to the XML syntax rules. If all tags in a document are correctly formed and follow XML guidelines, then a document is considered as well formed."

Importance

The concept well-formed document allows for a better understanding of the fundamental construction of XML. It helps to clarify XML beyond the typical sense of it. For example, while most XML Document Type Definition
Document Type Definition
Document Type Definition is a set of markup declarations that define a document type for SGML-family markup languages...

s utilize left and right angle brackets as content delimiters, strictly speaking this is not a necessity (though a delimiter should be terse and concise). The left and right angle bracket codes are a convention, albeit clear and distinctive, not an absolute requirement.

The concept of well-formed document also allows for the comprehension of the abstract nature of XML. In reality, there is no such thing as XML. Rather, XML is a principle that represents a set of behaviors and practices. It is possible to discuss types of XML, as expressed within a Document Type Definition (DTD).

Well-formed documents also bring into focus the issue of valid versus correct XML. According to the W3 Organization, valid documents are those that validate against a DTD. The rules of validity
Validity
In logic, argument is valid if and only if its conclusion is entailed by its premises, a formula is valid if and only if it is true under every interpretation, and an argument form is valid if and only if every argument of that logical form is valid....

 mean that a document complies with the restraints stated within a DTD. Thus, tags or entities must be in conformity to the rules and relations established within a DTD. However, there is no control on whether a tag or entity is correct. Thus a fist level head tag could be applied to a second level head object and be valid, while incorrect.

The emphasis on well-formed documents has developed within the publishing
Publishing
Publishing is the process of production and dissemination of literature or information—the activity of making information available to the general public...

 industry where the use of left and right angle bracket delimited information has become problematic. Emphasis on the well-formed document allows for the definition, delimiting, and nesting
Nesting (computing)
In computing science and informatics, the word nesting may denote several different constructions and activities where information is organized in layers or objects contain other similar objects. The rather general term is thus used in quite specific ways for various situations and concepts...

of content to be managed within programs that are not XML, per se, but exhibit the characteristics or potential for being well formed.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK