[xml] can I do _this_ with AttType?

Pretend I have a DTD that includes this:

    <!ELEMENT set EMPTY>
    <!ATTLIST set
        id CDATA #REQUIRED

I then have XML documents that include stuff like this:

    <set id='foo'/>

All good and well so far.  But now I want to limit the values that
set's id can take.  I know how to enumerate the legal values using
EnumeratedType like this:

    <!ELEMENT set EMPTY>
    <!ATTLIST set
        id (One|Two|Three) #REQUIRED

But that's not what I want.  In my world, "id" is one or more characters
from this set: [-a-zA-Z0-9].  It's easy enough to do use CDATA and verify
id manually after validating the DTD.  But my question is, can do this
in the DTD?  That'd sure be convenient.  Unfortunately I dont have the
brain pan to figure this out from the spec...

Sebastian Kuzminsky

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]