Core XML attributes

D

David Manheim

I am writing a module which is supposed to allow use of a set of
attributes in any XML document; there is a DTD for XHTML, but it will
need to work with all XML data types when imported.

I have written the Qname module, which I am having a bit of trouble
trying to verify (mostly simply because I haven't written the rest of
the module, I believe) but the main problem I am having is that I am
unsure how to make the attributes common to all tags; I understand how
to add them to, say, tags with a specific name, for instance;

<!ENTITY % p
"alignment (good|neutral|evil) #IMPLIED
damagetype (lightning|fire|water)
damage (1d6|2d6|3d6|4d6) #IMPLIED"
Would allow me to apply some D&D attributes to my paragraph elements,
when this is imported in my DTD along with, say, XHTML. (No, that's not
what I'm doing)) The problem is, if I want the attributes to apply to
every element, regardless of which other XML formats I'm using,
(understanding that they need to be unique, or prefixed) I don't
understandd how I can get the module to allow it for all tags.
 
D

David Carlisle

I don't understandd how I can get the module to allow it for all tags.

XML DTD does not support this.
You have to declare the attribute for each element.
Some DTD (eg xhtml) have a parameter entity defined which is called for
each element which means that you just need to add the attribute
declaration to this parameter entity, but in general you need to repeat
the attribute declaration for each element.

The websgml additions to SGML that added most of the bits
needed to make xml work smoothly as a subset of sgml did include an #ALL
syntax for this purpose but it didn't make it into XML (not sure why...)

http://www.sgmlsource.com/8879/n0029.htm

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top