Empty AttlistDecl
David Megginson
ak117 at freenet.carleton.ca
Tue Jan 27 13:49:57 GMT 1998
Stefan Mintert writes:
> What's the purpose of an empty AttlistDecl?
> Shouldn't production [52] read instead as follows?
>
> AttlistDecl ::= '<!ATTLIST' S Name AttDef+ S? '>'
>
> (+ instead of *)
Actually, it turns out to be remarkably useful for external DTD
subsets. Consider this:
<![%security;[
<!ENTITY % security-atts "
level CDATA #REQUIRED
auth CDATA #REQUIRED">
]]>
<!ENTITY % security-atts "">
<!ATTLIST section %security-atts;>
Now, if the %security; parameter entity is set to "INCLUDE" (to enable
security features), you will get
<!ATTLIST section
level CDATA #REQUIRED
auth CDATA #REQUIRED>
If the %security; parameter entity is set to "IGNORE" (to disable
security features), you will get
<!ATTLIST section>
Fortunately, this is still legal in XML.
All the best,
David
--
David Megginson ak117 at freenet.carleton.ca
Microstar Software Ltd. dmeggins at microstar.com
http://home.sprynet.com/sprynet/dmeggins/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list