Well-Formed XML |
In
a Nutshell:
Well-formed XML conforms to these four rules, determined by the
World Wide Web Consortium ( W3C):
- An XML document consists of a root element,
optionally preceded by a prolog and followed by miscellaneous content
(which
simply allows white space to exist there);
- XML
elements have either
- An opening tag, data, and a closing
tag; or
- A single self-closing tag.
- XML
tags begin and end with angle-brackets < > and
have a name.
- Opening tags may have attributes;
- Closing
tags have a forward slash immediately after the first angle-bracket </;
- Self-closing tags have a forward slash immediately before
the second angle-bracket />
- Elements
can contain other elements, but they cannot overlap. The first element
to open is the last to close.
|