E.4. XML DTDs and Schemas

document type declaration:

A declaration that may occur near the beginning of an XML document which prescribes the type name of the document element, sets up the information needed for the parser to handle the documents entity structure, and includes—directly or by reference—a DTD.

document type definition (DTD):

A part of an XML document contained in the document type declaration either directly or by reference, which provides a much weaker but similar capability in prescribing allowable types of attributes and elements at various points in the document.

Validity with respect to a DTD is defined by the XML Recommendation.

declaration:
  1. A character string beginning with ‘<!’ and ending with ‘>’, typically making up a comment, a document type declaration, or a part of a DTD, whose internal substring conforms to the requirements prescribed by the SGML Standard (ISO 8879) or the XML Recommendation. Not all XML declarations have this form, which is the prescribed form for SGML declarations. During the creation of XML, the creators tried to remain as compatible with SGML as possible and so used another form of declaration (definition 2) for those that were not SGML declarations.

  2. A processing instruction designated by the XML Recommendation to be a declaration. In SGML, processing instructions are reasonably used for nonstandard (not prescribed by the SGML Standard) declarations; for compatibility, XML uses them for some declarations.

  3. An attribute specification beginning with ‘xmlns’; namespace-aware processors will not treat such a specification as a normal attribute specification. (See namespace declaration in 12.4.1.)

  4. A schema component that can be referenced by name in an XML document: an element type, attribute type, or notation component. We do not use the term in this sense regularly in this book because in most of the SGML and XML community declarations are character strings that occur in the concrete representations of abstract classes (rather than being the abstract classes), and because we do not see any reason to restrict the terms ‘element type’ and ‘attribute type’ to those types only when defined by declarations in a DTD.

definition:

A schema component other than a declaration (definition 4) which can be given a name and referenced elsewhere in a schema. This terminology is used in the Schema Recommendation but not in this book.

schema component:

An instance of one of the classes defined and so designated in the Schema Recommendation.

element type:
  1. A class whose instances are elements. Each element type requires that its instances all have the same type name and all satisfy the same constraints on their content and attributes. An element type may originate from an element type declaration in a DTD or from an element element in a schema document.

  2. An element type specifically defined by an element type declaration in a DTD. (This meaning is common, but this book uses “DTD-defined element type.”)

  3. An element type (definition 1) specifically defined by an element in a schema document; one kind of schema component. It primarily binds a structure type to a name.

  4. An element type, as an object but not a class, also serves as a component in a content model, indicating that at that point in the model an element of that type is permitted. A few of the properties provided by element type are to enhance this purpose.

  5. Either an element type (definition 1) or the corresponding element type declaration or element. Used only when the distinction is irrelevant to the discussion in context.

element type declaration:

A declaration in a DTD used to define an element type: the XML representation of a DTD-defined element type. (In the early days of SGML, an element type declaration was called an “element declaration.”)

element :

A type of element in a schema document used to define an element type: the XML representation of a (schema-defined) element type.

attribute type:
  1. A class whose instances are attributes. Each attribute type requires that its instances all have the same type name and all satisfy the same constraints on their values. An attribute type may originate from an attribute definition in a DTD or from an attribute element in a schema document.

  2. An attribute type (definition 1) specifically defined by an attribute in a schema document; one kind of schema component. It primarily binds a structure type to a name.

attribute type declaration:

A declaration in a DTD used to define an attribute type: the XML representation of a DTD-defined attribute type.

attribute :

The element type of elements in a schema document used to define attribute types: the XML representation of a (schema-defined) attribute type.

DTD-defined element type or attribute type:

An element type whose XML representation is an element type declaration in a DTD (element type, definition 2), or an attribute definition in a DTD.

schema-defined element type or attribute type:

An element type or attribute type whose XML representation is an element or attribute, respectively, in a schema document.

concrete element type or attribute type:

An element type declaration or an attribute definition in a DTD, or an element or attribute: The XML representation of an (abstract) element type or attribute type. Used only when necessary to emphasize the parallel with (abstract) element types and (abstract) attribute types.

(abstract) element type or attribute type:

Element type (definition 1 or 2), or attribute type. Used only when necessary to emphasize the parallel with concrete element types or concrete attribute types.

element declaration schema component:

Schema-defined element type.

The standard notation in the Schema Recommendation; used in this book only when necessary to correlate with material from that source. (The Schema Recommendation does not adopt the “classes are special kinds of objects” approach; the class is only closely related to the element declaration schema component, which is the object. The Recommendation focuses on the object, and its terminology is in terms of validity with respect to the object, rather than of being an instance of the class.) The Schema Recommendation prefers to use the term ‘element type’ solely for what we call “DTD-defined element type.”

attribute declaration schema component:

Schema-defined attribute type.

This is the standard notation in the Schema Recommendation; used in this book only when necessary to correlate with material from that source. (The Schema Recommendation does not adopt the “classes are special kinds of objects” approach; the class is only closely related to the attribute declaration schema component, which is the object. The Recommendation focuses on the object and its terminology is in terms of validity with respect to the object, rather than of being an instance of the class.)

simple type:

A component of a schema; a class whose instances are elements and attributes; it restricts the value of its instances according to rules set forth in the Schema Recommendation. See datatype in Section E.5 for a more complete discussion. (In the Schema Recommendation, a simple type is called a “simple type definition schema component.”)

complex type:

A component of a schema; a class whose instances are elements. It restricts the content and attribute set of its instances according to rules set forth in the Schema Recommendation. (In the Schema Recommendation, a complex type is called a “complex type definition schema component.”)

structure type of an element type or attribute type:

The simple type or complex type which is the value of the type property of an element type; the simple type which is the value of the type property of an attribute type.

instantiable type:

A complex type or element type that does not require a derivation or substitution to instantiate directly in an XML instance. (See also instantiable class.) All attribute types and simple types are instantiable.

non-instantiable type:

A complex type or element type that requires a derivation or substitution to instantiate directly in an XML instance. Explicitly non-instantiable complex types and element types have their abstract property TRUE; an element type can be implicitly noninstantiable by having a noninstantiable structure type. (See also non-instantiable class.) No attribute types or simple types are non-instantiable.

base (simple or complex) type:

Simple types and complex types benefit from object-oriented class inheritance. A base type is the simple type or complex type from which another is derived.

derived (simple or complex) type:

A derived type is a simple type or complex type derived from a base type. In an XML schema, derivation occurs by extension or restriction. Chapter 10 and Chapter 11 discuss extension and restriction in detail. A derived type is analogous to what some might call a subclass.

content pattern:

A content pattern specifies a set of content options available for a specific element in an XML Schema. The content pattern loosely follows a simplistic regular expression. Appendix A includes a brief discussion regarding the grammar, or format, of a content pattern. This is a notation adopted for this book because of its conciseness.

notation declaration or component:

An association of a name with either or both of a system identifier and a public identifier, which are described in the XML Recommendation. Used during DTD or schema processing to create notation information items as needed in an infoset in response to identifying an appropriate name in a (concrete) XML instance.

Notation is not well defined in XML or SGML: Its semantics are determined by the application. The original intended use, and still one current use, is to identify character streams not in XML (or SGML), such as EPS graphics. In fact, a notation information item simply conveys to the application a system identifier or public identifier, which the application must interpret.

DTD-valid XML document:

An XML document that satisfies the validity constraints of its DTD. In the XML Recommendation, this is called simply “valid”; at the time of its publication, this was the only kind of validity defined.

schema-valid XML document:

An XML document that satisfies the validity constraints of a schema.

valid XML document:

An XML document that is DTD- or schema-valid. Usually used when the context makes it obvious which is intended. In this book, usually schema-valid.

XML validator:

An XML validator is a program—or a module in a program—that examines XML purported to be an XML instance and validates that XML against an XML schema or DTD.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.29.48