Re: html character entity references in sxml

[email protected] Wed, 7 Apr 2004 12:27:45 -0700 (PDT)
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
Hello!

	Sorry for the delay in replying: I was out of town.

> For examples, "&copy;" or "&#257;".
> 
> I suppose those two examples could be represented as, respectively,
> '(ENTITY-REF . copy) and '(ENTITY-REF . 257) , but I'm not sure SXML
> intends that.

The case of "&copy;" is simple -- it is a named entity
reference. Presumably, "&copy;" is not an internal entity reference.
Therefor, we can use the existing SXML notation *ENTITY*. According to the
SXML specification, *ENTITY* takes the public ID and the system
ID, which, in the case of "&copy;" we should invent. For example,
	(*ENTITY* "copy" "")
or
	(*ENTITY* "additional" "copy")
etc.
As to "&#257;", it is actually a character reference (which the SSAX
parser, for example, always converts to the corresponding character,
using ucs2->char. In XML, all character references are in UCS2, always,
regardless of the encoding for the document text). Still, if
the appearance of such characters in the text is undesirable, we can
stretch the *ENTITY* notation a little and write, for example,
	(*ENTITY* "additional-char" "257")

This is a bit verbose -- OTH, neither "&copy;" nor "&#257;" are
frequent in one document, so the overall overhead is probably not that
large.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click