Table of contentsAppendices |
3.1 Start-Tags, End-Tags, and Empty-Element TagsStart-Tags, End-Tags, and Empty-Element TagsThe beginning of every non-empty XML element is marked by a start-tag. Start-tag
The Name in the start- and end-tags gives the element's type. The Name-AttValue
pairs are referred to as the attribute specifications of the
element, with the Name in each pair referred to as the attribute name
and the content of the AttValue (the text between the Well Formedness Constraint: Unique Att Spec Unique Att SpecAn attribute name MUST NOT appear more than once in the same start-tag or empty-element tag. Validity Constraint: Attribute Value Type Attribute Value TypeThe attribute MUST have been declared; the value MUST be of the type declared for it. (For attribute types, see [Attribute-List Declarations].) Well Formedness Constraint: No External Entity References No External Entity ReferencesAttribute values MUST NOT contain direct or indirect entity references to external entities. Well Formedness Constraint: No < in Attribute Values No< in Attribute Values
The Replacement Text of any entity
referred to directly or indirectly in an attribute value MUST NOT contain a An example of a start-tag: <termdef id="dt-dog" term="dog"> The end of every element that begins with a start-tag MUST be marked by an end-tag containing a name that echoes the element's type as given in the start-tag: End-tag
An example of an end-tag: </termdef> The Text between the start-tag and end-tag is called the element's content: Content of Elements
An element with no content is said to be empty. The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. An empty-element tag takes a special form: Tags for Empty Elements
Empty-element tags MAY be used for any element which has no content, whether or not it is declared using the keyword EMPTY. For interoperability, the empty-element tag SHOULD be used, and SHOULD only be used, for elements which are declared EMPTY. Examples of empty elements: <IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" /> <br></br> <br/> |