Trying to achieve something like this
ATTLIST employee role (leader|analyst|leader,analyst)
where I can't change it into an element; it needs to be an attribute.
It seems like DTD doesn't like commas in its expressions.
Trying to achieve something like this
ATTLIST employee role (leader|analyst|leader,analyst)
where I can't change it into an element; it needs to be an attribute.
It seems like DTD doesn't like commas in its expressions.
An attribute in XML cannot contain elements.
You're really going against the grain to try to add structure to attributes in any way. If you must do it, keep it simple: You can represent a list via space or comma-separated values. Going any further runs into requiring a separate micro-parser distinct from an XML parser just to parse the attribute values. It's not a good idea, and don't expect support from DTD beyond that which is provided by NMTOKENS
, IDREFS
, or ENTITIES
See also: XML Element vs XML Attribute