xsl-list
[Top] [All Lists]

RE: Encoding attribute

2004-01-29 17:11:10
I don't understand very well what kind of encoding I must 
utilice. I live in Spain and I read that I must utilice 
ISO-8859-1 characters and I put always in XML files the <?xml 
version="1.0" encoding="ISO-8859-1"?>  and in the XSL files 
when I want to escape HTML I put always <?xml version="1.0" 
encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

If you're entering your source XML documents and stylesheets using a
text editor, then you need to specify the encoding that your text editor
is configured to use, which is probably ISO-8859-1 by default (actually
it might be the Microsoft variant of that, but that's sufficiently close
that it doesn't usually matter).


<xsl:output method="html"/>
The problem is when I want to put some "especial" characters 
like "€" , non-breaking espaces, etc... I put in the XSL 
StyleSheet when I want to display "euro" character &euro; 
&#8364; but whith &euro; he tells me "Entity Reference not 
defined" and with &#8364; I see another character. Any 
suggestion, please?

You can't use entity references like &euro in XML unless you declare
them. If you use them, you must declare them in the DTD.

You can use numeric character references like &#8364 without declaring
them. If the result of your transformation is displayed incorrectly,
this is because the software that is displaying the output (for example
a browser or a text editor) thinks the file is in one encoding when it
is actually in another (alternatively, it might be using a font that
doesn't contain a glyph for that character). The answer is either to
change the encoding specified in xsl:output to match what your display
software expects, or to change the configuration of your display
software so that it handles the actual encoding of the file. The details
of how to do this are highly specific to your choice of software.

Michael Kay


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



<Prev in Thread] Current Thread [Next in Thread>