Brion,
 
While I am sure the common response might be taking a look at Schemas, because they are much more rich, here is another idea.  As a general rule (general mind you), attributes are used for meta-data, and content is reserved for the data itself.  In your case, it appears you have extensive meta-data requirements, for which attributes might not be sufficient.  Rather than trying to implement this extensive meta-data as attributes, why not declare a new element "meta" as the first element in foo's content model?  Meta then serves as a very rich header for all of the following data.
 
<!ELEMENT foo (meta, <.....other elements in the content model here>)>
<!ELEMENT meta ANY>
 
This way, your meta-data is not only unlimited, but can also be hierarchical.
 
BradO
-----Original Message-----
From: Swanson, Brion [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 14, 2001 9:44 AM
To: '[EMAIL PROTECTED]'
Subject: First-time writing DTD - simple question

I have a fairly simple question regarding attribute delcarations in a DTD.
 
I know it's possible to declare an element of content type 'ANY', but can do you do the same for the attribute list?
 
What I need is an element who's name is guaranteed (let's say 'foo'), but which may have any number of attributes whose names do not matter.
 
An example would be:
 
<foo test1="value1" test2="value2" whatever="don't care"/>
 
Is this possible in a DTD?  If so, what might be the declaration given the 'foo' example?
 
Thank you for your help.

--------------
Brion Swanson
Software Engineer (Co-op)
West Group - Public Records
[EMAIL PROTECTED]
716-327-6164 (x6164)

 

Reply via email to