Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML declaration in DTD System ID? ... [Thread Next] Re: XML declaration in DTD System ID? ...To: NULL Date: 7/13/2009 5:20:00 PM Russell Potter <russ.potter@b...> writes:
>> How do you write an element declaration for an element type with a
>> name containing non-ASCII characters?
>
> Wouldn't you just use a character entity? ("&#XX;") for
> each sppearance of such a non-ASCII charaacter within
> the element declaration'a name?
Er, no, you wouldn't.
Neither general entity references nor numeric character
references are recognized in declarations in a DTD; they may be
included in the replacement text of entity declarations, in
attribute-value literals, processing instructions, system
identifiers, and comments, but not in the Name paramter of an
element declaration (or for that matter at any other location
except those indicated).
References (whether entity references or character references)
are recognized in places where the spec explicitly mentions
them in the grammar (e.g. in the declarations for entity values
and attribute values [EntityValue and AttValue]) or in the
prose (e.g. in the definition of markup at the beginning of
section 2.4), but not everywhere. This sometimes takes
readers by surprise if they come to XML from environments
where character escaping is handled in a way more or less
completely oblivious to context. XML gets its handling
of references from SGML, where most constructs including
references are recognized in some contexts and not
recognized in others.
Good luck with your parser.
Michael Sperberg-McQueen
--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
