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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.