Datatypes for DTDs 2.0

Abstract

This specification provides namespace-based XML-conformant means for DTDs to specify datatypes for attribute values and for data content of elements. It thereby facilitates interworking and conversion between DTDs and other schema definition notations within the DSDL framework.

Differences from Version 1.0

Version 1.0 used notation declarations and reserved attribute names for the datatype declaration attributes. This version uses namespaces to identify those attributes and therefore does not impact the information set in the same way.

Table of Contents

1. Datatype Declarations

A datatype declaration is an attribute definition named "dsdl:a" or "dsdl:e", where "dsdl" is the namespace prefix for this specification (see 2. Namespaces). The declaration must have a fixed attribute default value.

Content datatype declaration


[1]dsdl:e::=dtypeName
[2]dtypeName::=QName

The value of the "dsdl:e" attribute is a dtypeName, defined as the name of a datatype, including the namespace prefix for any explicitly declared datatype namespace (see 2. Namespaces). The dtypeName is associated with the data content of elements to which the attribute-list declaration applies.

Attribute datatype declaration

The value of the "dsdl:e" attribute is a series of name/value pairs according to the following syntax:


[3]dsdl:a::=S? ( attrName S dtypeName ) (S attrName S dtypeName)* S?

An attrName is the name of an attribute declared in the same attribute-list declaration. The dtypeName that follows it is associated with the values of attributes of that name.

For example:


<!ATTLIST person
          birthdate CDATA     #IMPLIED
          height    CDATA     #IMPLIED
          dsdl:a    CDATA     #FIXED
                   "birthdate date
                    height    decimal"
>

2. Namespaces

A datatype declaration must occur within the DTD scope of a namespace for this specification. That is, the namespace must be declared as a fixed default attribute of the element type to which the datatype declaration applies, or of one of its ancestors (such as the document-element type). The syntax is as follows, although the prefix "dsdl", while recommended, may be changed.

xmlns:dsdl CDATA #FIXED "http://whatever the DSDL spec says"

A datatype declaration must also occur within the DTD scope of namespace declarations for any prefixed dtypeNames that it uses. Unprefixed dtypeNames belong to the namespace:

"http://www.w3.org/2001/XMLSchema-datatypes"

3. Information Set Contribution

NOTE: The principle of Information Set Contributions is established in the W3C XML Schema specification.

In an information set supporting this specification: