Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DTD ATTLIST Range of Numbers

Tags:

xml

xsd

dtd

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.


1 Answers

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.

like image 159
lavinio Avatar answered Dec 10 '25 11:12

lavinio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!