[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why are erroneous ENTITY declarations not caught inXML val
On 23/10/2012 11:29, David Carlisle wrote: > ... another interesting feature is that in an entity declaration after a & the following characters have to match the productions for entity or character references (including a trailing colon) even though the entities may not be used, so... <!DOCTYPE x [ <!ENTITY foo "<![CDATA[ &hhh; ]]>" > <!ELEMENT x (#PCDATA)*> ]> <x>&foo;</x> is well formed and valid, use of the reference to foo does not result in an error, it is equivalent to: <x> &hhh; </x> However if you remove the ; to get <!DOCTYPE x [ <!ENTITY foo "<![CDATA[ &hhh ]]>" > <!ELEMENT x (#PCDATA)*> ]> <x>&foo;</x> The result is not well formed: $ rxp -xV ent.xml Error: Expected ; after entity name, but got <space> the use of & within an entity declaration has to be syntactically a reference, even though if expanded the & would not start a reference as it would be quoted by the CDATA declaration. David -- google plus: https:/profiles.google.com/d.p.carlisle ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
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
|