tags:

views:

66

answers:

1

I have a DTD and I would like to limit a few attribute properties' possible values to, say, "yes" or "no".

<!ATTLIST node postgrad CDATA "">

How do I do that?

A: 

By defining that the attribute postgrad can have values yes or no:

<!ATTLIST node postgrad (yes | no)>

That will do it =)

ChrisAD
That worked, thanks! I had to declare a default value though in order for my validator to accept the DTD. Did I do something wrong?
Lenni
Hmm, no I dont think so. I dont see why the validator bites on that one. You could try an online validator. Im using NetBeans XML addon myself. You might wanna try #IMPLIED on the end. That way you tell the validator that attribute is not required, but can be used if needed.
ChrisAD