What to call a conforming instance of an XML datatype
In my series on potential areas of confusions, let me cover one that has more do to with terminological correctness: What is the term for a valid instance of an XML datatype that is not constrained by an XML Schema collection?
Many writers that I have read over the last couple of weeks used the term “well-formed” (and I would not be surprised if we used the same term in some of our own literature). The term “well-formed” is an important term in XML 1.0:
[Definition: A textual object is a well-formed XML document if:]
-
Taken as a whole, it matches the production labeled document.
-
It meets all the well-formedness constraints given in this specification.
-
Each of the parsed entities which is referenced directly or indirectly within the document is well-formed.
Matching the document production implies that:
-
It contains one or more elements.
-
[Definition: There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.] For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.
However, an XML datatype according to the ISO SQL-2003 standard allows any valid element content at the top. Basically it can match:
XML datatype ::= prolog content
Obviously, this allows instances that are not well-formed according to the definition above (such as top-level text nodes, zero or more than 1 top-level element). So what should we call such XML fragments?
Some terms that I have heard and used myself over times are:
1. XML fragment
2. well-balanced XML
3. well-balanced XML fragment
4. XML content
5. XML datatype instance
Now 5 is a no-brainer, but then it is tautological :-).
Please feel free to express your preference and propose your own terms.