DTD Bounds - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

DTD Bounds

I'm creating a DTD and one of the restrictions I need to implement is that the value of an element has to be bounded by 2 numbers. For example:

<!ELEMENT Value (Number)>
<!ATTLIST Value
max CDATA #IMPLIED
min CDATA #IMPLIED
>
<!ELEMENT Number (#PCDATA)>

And the value of number has to be between min and max. Is this possible with a DTD?
I know this is possible with xmlschema but I'm wondering if this can be done with a DTD. Thanks.

Sign In or Register to comment.