[xslt] ISO-8859-1 problem



HI,

I have a Perl system which has to build a lot of latin1 XML,  apply a XSL stylesheet to and  print the HTML results.

So I'd like to use XML::LibXSLT: I have installed it on my Linux redhat 8.

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.

Then I have tried to use xsltproc (with -o pippo.html) and all seems ok.

Can someone help me? Does it exist some encoding problem with XML::LibXSLT?

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?

I ahve tried to use XML::LibXML::encodeToUTF8 when I build my XML file with XML::Twig. but the result is the same.

MY perl code is:


my $parser = XML::LibXML->new();
 my $xslt = XML::LibXSLT->new();
my $source = $parser->parse_string($xmlfile);
my $style_doc = $parser->parse_file($XSL);
my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source);

            my $nomefilefinale = $urltot . "_$i" . '.html';

            open(XML,">$nomefilefinale");
            $stylesheet->output_fh($results,\*XML);
            close(XML);

 Thanks a lot

--Marco


-----------------------------------------------------

Salve, il messaggio che hai ricevuto
 stato inviato per mezzo del sistema
di web mail interfree. Se anche tu vuoi 
una casella di posta free visita il
sito http://club.interfree.it
Ti aspettiamo!

-----------------------------------------------------





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