<& in internal entity values

James Tauber jtauber at jtauber.com
Fri Aug 28 15:10:23 BST 1998


-----Original Message-----
From: Peter Jones <peterj at wrox.com>

>Can anyone tell me why productions [9] of the XML 1 spec says that the &
>char is not allowed within an entity declaration but the section 2.4 on
>Char Data below says that they are. Section 2.4 seems to suggest that
>the following is o.k.
>
><!ENTITY   punctuation    "<&" >
>
>Is it?

No.

I am guessing that what confused the issue was the sentence "They are also
legal within the literal entity value of an internal entity declaration".

The reason for this sentence is that AT THE TIME OF DECLARATION, < and & in
a literal entity value are not treated as markup delimiters.

2.4 says that
"The ampersand character (&) and the left angle bracket (<) may appear in
their literal form only when used as markup delimiters, or within a comment,
a processing instruction, or a CDATA section".

Now because < and & are not markup delimiters in a literal entity value at
the time of declaration, the additional sentence "They are also legal within
the literal entity value of an internal entity declaration" is added.

< and & are treated as markup delimiters only at the point of reference.

Hope this helps.

James
--
James Tauber / jtauber at jtauber.com      http://www.jtauber.com/
Lecturer and Associate Researcher
Electronic Commerce Network             ( http://www.xmlinfo.com/
Curtin Business School                  ( http://www.xmlsoftware.com/
Perth, Western Australia                ( http://www.schema.net/


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