Confusion about conditional sections

Chris Olds colds at
Sat Feb 20 01:31:17 GMT 1999

Section 3.4 says "If the keyword of the conditional section is IGNORE, then
the contents of the conditional section are not logically part of the DTD."
All productions 63-65 say is that all of the "<![" and" ]]>" (sic) in an
ignored section have to nest properly, and any other characters have to
match 'char'.

As to the entity problem, a general entity containing the string "]]>" is
not well-formed (whether it is used or not), since 4.3.2 says "An internal
general parsed entity is well-formed if its replacement text matches the
production labeled content".  Unfortunately, the next line says "All
internal parameter entities are well-formed by definition.", but there is no
production that actually defines this constraint.  The result of this is
that the following example appears to be legal if the value of
'%IncludeMe;' is either 'INCLUDE' or 'IGNORE':

     <!ENTITY % DangerousOpen "<![%TryMe;[ The text of my first entity">
     <!ENTITY % DangerousClose "The text of my second entity ]]>">

Note that in place of GE definitions, I used PE definitions, which don't
have to match 'content'.  Whether or not you can use these entities as part
of a DTD is unclear to me.  I wouldn't advise it.

Bottom line: productions 63-65 explicitly permit the scanning loop you


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list