Re: [xslt] ISO-8859-1 problem



spinmar@interfree.it writes:
> 
> I have tried to trasform my xml file ( with encoding iso-8859-1)  with my XSL (with <xsl:output encoding="ISO-8859-1" ..../> but the letters ò è à ù are bad trasformed.
> 
Works for me.
Of course you have to indicate the encoding of your xml.
Feeding "<x>ä</x>" to parse_string will not work, since the default encoding 
is utf-8.
"<?xml version="1.0" encoding="iso-8859-1"?><x>ä</x>" should work.

> I have used libxml2 a lot:  well in libxml2 all data must be UTF-8  (whne you build your xml file). Is it true also with XML::LibXSLT?

This refers to manipulation the tree directly. If you simply parse xml strings
or files you can use other encodings as well, as long as you indicate the
encoding.

Depending on the perl version you use, you might also get into trouble because
perl possibly stores the string in utf-8 internally in which case the 
iso-8859-1 encding declaration would be wrong. I never saw such problems 
yet, though.
If you parse files, this cannot happen, since the file read by libxml/libxslt
directly then.

greetings
	Morus

PS: the perl-xml mailing list might be a better place to discuss
XML::LibXML / XML::LibXSLT questions (all the perl experts are there)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]