[XML-SIG] need help: Sax can't read w3 dtds?
and-xml at doxdesk.com
Fri Aug 6 15:44:21 CEST 2004
Mike Brown <mike at skew.org> wrote:
>> <!ENTITY lt "&<" ><!-- less-than sign, U+003C ISOnum -->
> That's not an error.
It *is* an error, regardless of your opinion of whether XML technically
allows "&<" as a literal entity value(*). XML 1.0 SE 4.6 says:
If the entities lt or amp are declared, they must be declared as
internal entities whose replacement text is a character reference to
the respective character (less-than sign or ampersand) being escaped
The entity value "&<" yields replacement text "&<" which clearly
is not a character reference to the less-than sign.
This is acknowledged and fixed in m12n SE:
<!ENTITY lt "&#60;" ><!-- less-than sign, U+003C ISOnum -->
* - IMO such a replacement text technically allowable by implication of
XML 1.0 SE 2.3:
Although the EntityValue production allows the definition of an entity
consisting of a single explicit < in the literal (e.g., <!ENTITY mylt
"<">), it is strongly advised to avoid this practice since any
reference to that entity will cause a well-formedness error.
but it's incompatible with tools like DOM which require the replacement
text to be parsed as-is without an explicit entity reference, to form
the content of the Entity node.
mailto:and at doxdesk.com
More information about the XML-SIG