Xml – DTD ATTLIST Range of Numbers


Hi is it possible to only allow a range of numbers in an ATTLIST?

I know you can have an enumeration of a set as follows:

But it is possible to have 0 – 100, without having to type all 100 numbers? Thank you.

Best Solution

Because DTD's don't support a type system (other than specialized notational types such as NOTATIONS, and IDREFS and NMTOKENS inside of attributes) there isn't any way to actually specify a type as numeric, much less give it a range.

Every element that can contain text is PCDATA, or parsed character data.

If you were to use XML Schemas (XSDs vs. DTDs), there is a way to apply a range to an integer.

Related Question