xsl-list
[Top] [All Lists]

RE: service marks and other special symbols

2006-03-02 17:22:40
 
I have a perplexing issue that I just can't figure out.  I 
want to have my xsl document output the code for the service 
mark symbol (℠) but it looks like the xsl parser 
replaces the code with a ? or square symbol in the html 
stream.  

Let's try to get the terminology right first: an XSLT processor takes a
source tree as input and produces a result tree as output. The XML parser
converts the source XML into a source tree, and the XSLT serializer converts
the result tree into serialized XML or HTML. The HTML is then typically
displayed on the screen by some software, such as an editor or a browser.
The thing that's putting the ? or square symbol on your screen is this last
component, the display software, which is about as far from the parser in
this sequence of events as you could get.

If the display software is failing to display the character correctly this
could be because the character isn't present in the font, or it could be
because it's misconfigured to think that the document is in a different
encoding from its actual encoding.

The serializer has almost certainly put the correct character in the output,
but you're having difficulty seeing it there because of the limitations of
your display software.

It can be helpful in such cases to force the serializer to output the
character as a symbolic character reference, and the simplest way to do this
is to set <xsl:output encoding="us-ascii"/>. There's no need to use
character maps or disable-output-escaping for this. A better solution,
however, would be to work out what's actually going wrong downstream on the
display side.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--