xsl-list
[Top] [All Lists]

Re: eacutes driving me nuts

2004-06-09 21:50:54
On Thursday 10 June 2004 11:57, Deirdre Saoirse Moen wrote:
do I need to do something in the XML phase
(i.e. the input) or the XSL phase (i.e. the transform)? Or both? So
far, I've tried only the former and needed migraine medication from the
head-thumping.

The proper tack would be to ensure that the ASCII -> XML is done in an 
encoding-aware manner. 
I.e, When you read the ASCII, you need to know its encoding, probably 
ISO8859-1.
You don't need (and possibly is better without) the é entity 
declaration.
So it is a matter of 'how' things becomes XML. If you are converting with 
Java, you would be reading the ASCII something like;

FileInputStream fis = new FileInputStream( file );
InputStreamReader in = new InputStreamReader( fis, "ISO8859-1" );
BufferedReader reader = new BufferedReader( in );
String line;
while( ( line = reader.readLine() ) != null )
{
    :
}

If you are using less sophisticated methods, you 'might' get away with setting 
the encoding for the XML document correctly ( the <?xml version="1.0" 
encoding="ISO8859-1"?> ), but it would still not produce the character 
sequence "&eacute;", but the character directly.


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+



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