[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Yet Another Entity Ref question!


Subject: Re: [xsl] Yet Another Entity Ref question!
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 19 Dec 2002 13:00:05 -0700 (MST)

Marco Guazzone wrote:
> I'd like to produce an entity reference, say "&copy;", from XML to HTML
> through XSLT;

Put Unicode character #169 (the copyright symbol) in your stylesheet
with &#169; or &#xA9;

Change your output encoding to us-ascii to ensure that the XSLT processor
won't emit that character directly encoded. ASCII does not have a copyright 
symbol, so the processor will emit a numeric character reference like &#169; 
or an entity reference like &copy.

You won't be able to control whether the processor emits &#169; or
&copy;, but I believe most XSLT processors try to emit entity refs when
the character falls in the latin-1 range and isn't able to be expressed
directly in the given encoding.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords