Lists Home |
Date Index |
[I sent the following to email@example.com. Am I completely crazy, or are
some clarfications called for in the spec? Would you think either of the
following examples were not well-formed?
Example: <foo bar="]]>"/>
Example: <!ENTITY cdend="]]>">
With respect to section 4.3.2 of the XML 1.0 Specification Second Edition
and by implication XML 1.1 CR, there appear to be several ambiguities
engendered by the following statement:
An internal general parsed entity is well-formed if its replacement
text matches the production labeled content.
... when considered in the context of CDATA Sections and "]]>". For example,
this would imply that the following declaration in an internal DTD subset
would result in an internal general parsed entity that is not well-formed:
<!ENTITY cdend "]]>">
... because the replacement text does not match the  content production.
If so ...
1) This contradicts statements about Literals in section 2.3, namely:
Literal data is any quoted string not containing the quotation mark
used as a delimiter for that string. Literals are used for
specifying the content of internal entities (EntityValue),
... and production  EntityValue. Production  permits "]]>" as a
Furthermore,  AttValue also permits "]]>". It would be nonsensical for
<foo bar="]]>"/> to be well-formed, but not <foo bar="&cdend;"/>, using the
entity declaration above.
2) This contradicts the last paragraph of section 4.3.2:
A consequence of well-formedness in entities is that the logical
and physical structures in an XML document are properly nested; no
start-tag, end-tag, empty-element tag, element, comment, processing
instruction, character reference, or entity reference can begin in
one entity and end in another.
The list appears to be intended to be exhaustive. The lack of "CDATA
Section" in the list might be interpreted to mean that you can start a CDATA
Section in one entity, and end it in another. Therefore, the declaration of
&cdend; above should be well-formed.
Since the well-formedness of internal general parsed entities is completely
defined by productions  GEDecl,  EntityDef, and  EntityValue,
what is the value of the statement in section 4.3.2? What does it intend to
Perry A. Caro
Adobe Systems Incorporated