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.
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.
| [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.
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"
>
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"
NOTE: The principle of Information Set Contributions is established in the W3C XML Schema specification.
In an information set supporting this specification: