LiMar
LiMar

Reputation: 2962

DTD definition for dynamically defined attributes

Is it possible to specify in DTD a method to declare new attributes in the XML itself and use them in its elements?

Example of an XML I want to describe in a DTD:

<attribute-descriptors>  
    <attribute name="attr1" description="attr1 description">  
    <attribute name="attr1" description="attr1 description">  
</attributes-descriptors>  

<entity attr1="value1" attr2 ="value2">
<entity attr1="value11" attr2 ="value22">

Here I've declared new attributes attr1 and attr2, which were not known at the XML design stage. And used them to enrich elements.

My custom soft can take care of such a declaration, but how to describe it in DTD or may be other XML specifying language?

Upvotes: 0

Views: 152

Answers (1)

Daniel Haley
Daniel Haley

Reputation: 52858

This is not possible in DTD.

The DTD defines the XML. The XML does not define the DTD.

Upvotes: 1

Related Questions