Re: [xsl] Preseving character entities

Subject: Re: [xsl] Preseving character entities
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 29 Nov 2004 15:31:57 GMT
> You will have to elaborate. I don't see why named entity references 'have' to be of SDATA type..

That isn't what I said. Clearly entity references don't have to be SDATA.

entities are always named, so "named entity references" are the same as
"entity references" and can be of any type allowed in the language under
consideration (XML or SGML).

SGML, but not XML, had a specific SDATA  entity type that was used for
producing something that was essentially a named character, &alpha; in 
HTML doesn't really expand to anything: it's just reported by the parser
as a named reference to a system specific character called alpha.

In XHTML it's completely different: &alpha expands to the unicode
character 945 and will just be reported as that by the XML parser with
the fact that there was an entity reference perhaps not being reported
at all (and being ignored even if reported when building an Xpath data
model).

While it's not uncommon for people to use the terminology appropriate to
HTML SDATA references when talking about XML entity references, it's a
practice best avoided. &alpha; and &#945; are different beasts and
expanded at different times by an XML parser. The XML spec calls the
first an entity reference and the second a character reference
one may argue whether another terminology would have been clearer, but
what's done is done and so using "character reference" even prefixed
with "named" to refer to something that by definition is not a character
reference just helps deepen confusion not lessen it.


David




________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread