[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: silly (c) symbol. How to get © in output ?

Subject: RE: silly (c) symbol. How to get © in output ?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Thu, 24 Apr 2003 16:52:37 -0400
c system output
[malcolm macaulay]

> In my previous post the first example was supposed to use 
> #169; with little 
> ampersand in the front.
> 
> cheers
> 
> Malcolm
> 
> >Date: Fri, 25 Apr 2003 08:18:32 +1200
> >
> >I'm having a lot of trouble getting *&copy;* (the copyright 
> system) to 
> >output.
> >
> >I know this problem has been explained before but I can't 
> find the thread 
> >which has a working answer.
> >
> >I'm getting this:
> >
> ><xsl:text disable-output-escaping="yes">©</xsl:text> gives 
> the actual (c) 
> >symbol in the HTML doc which looks like this: © in the 
> browser but look OK 
> >in XMLSpy.
> >

This is a character encoding issue.  The output file is probably in utf-8 encoding (which Spy is reading just fine), but the browser thinks it is receiving something else, probably iso-885901 (i.e., latin-1).  Your character takes two bytes in utf-8 but the browser's encoding uses only one byte per character, so it displays two characters, neither one being what you wanted.

Either you have to specify the output encoding that the browser is set for, or (better) add a <meta> element that tells the browser which encoding you are using.  You can find the right syntax for this through Google.  I am assuming here that you are outputting HTML.

> ><xsl:text>&copy;</xsl:text> gives an undefined entity error.
> >
> ><xsl:text disable-output-escaping="yes">&copy;</xsl:text> gives an 
> >undefined entity error.
> >

Of course you get that result, xml does not know anything about all those html entities for special characters unless you put them in a DTD.  It will work if you use a numeric reference like &#169; and a browser will also recognize it.

And you do not need to use d-o-e, either.

Cheers,

Tom P

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.