views:

221

answers:

2

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.

A: 

No, it's not

DTD does not distinguish data types (e.g. string vs integer) and thus has no notion of ranges.

ChssPly76
+1  A: 

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.

lavinio