Antonio Pérez
Antonio Pérez

Reputation: 6962

Open/unrestricted attribute list for an element in a DTD?

Is it possible, within a DTD, to define an element to have an open/unrestricted attribute list?

I know it can be defined an element to have unrestricted child elements:

<!ELEMENT element_name ANY>

But, tutorials and references that I have already consulted seem to assume that the attribute list for an element must be complete. And I couldn't find any explicit reference to this situation.

Upvotes: 0

Views: 308

Answers (1)

peter.murray.rust
peter.murray.rust

Reputation: 38033

Not if you wish to validate it. (ZVON gives a good overview of DTD): http://zvon.org/xxl/DTDTutorial/General/contents.html. If you do not use a validator then any well-formed XML is allowed.

In XSD schema it is possible to allow undeclared attributes including those from other namespaces (namespaces are very difficult to manage in DTDs).

Upvotes: 1

Related Questions