tags:

views:

93

answers:

2

Hello everyone. Is it possible to declare an element in my DTD which can have ANY name? So far I have learnt that ANY can be used only for the data type as in:

<!ELEMENT element-name ANY>

Any help will be most appreciated.

-- Ali

+1  A: 

No, the ANY keyword only applies to the element's category. What would the semantics of ANY as a name be, anyway? Whatever it is that you're hoping for, DTD doesn't have it.

Alex Martelli
A: 

Yes, but not for the reason that I think you want to.

See 3.2 Element Type Declarations of the XML 1.0 specification, productions 45 and 46, at

http://www.xml.com/axml/target.html#elemdecls

ANY is an XML keyword, and part of the contentspec, and means that the content of the element can be anything that doesn't break the rules of XML.

You could use the name 'ANY' to name an element type, but it wouldn't have the semantics of the ANY keyword, when used in a content model.