|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: newbie question: using < in entity declaration
In article <LPBBKEHNJECMPNOKMDIAMEDDCAAA.duddu@v...>, Sarveshwar Rao Duddu <duddu@v...> wrote: >I have a doubt in whether or not it is legal to declare something like: > ><!ENTITY lt "<"> Short answer: it's not legal. Long answer: There are actually two issues here: whether any entity can be declared like that, and whether the entity "lt" can be. Consider <!ENTITY mylt "<"> This declaration itself is legal, but any use of it will inevitably not be. This is because to be well formed, an internal general parsed entity must match production [43] (content), and for a document to be well formed all the parsed entities it references must be well formed. The declaration <!ENTITY lt "<"> is an error. It's not a fatal error, so a parser need not report it; I think the justification for this is that a parser can just ignore the declarations of the predefined entities. That it's an error is not entirely clear from section 4.6 (it's possible to interpret the definitions given there as merely examples), but will be clarified in an erratum that has not yet been published: If the entities lt or amp are declared, they must be declared as internal entities whose replacement text is a character reference to the character being escaped; the double escaping is required for these entities so that references to them produce a well-formed result. If the entities gt, apos or quot are declared, they must be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is unnecessary but harmless). -- Richard -- Spam filter: to mail me from a .com/.net site, put my surname in the headers. "The Internet is really just a series of bottlenecks joined by high speed networks." - Sam Wilson *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








