R
Rwag
Hello,
I am migrating a perl production system from Solaris to Linux. My
knowlege of Perl and processing of XML is brief.
The issue we have is that we need to process data files. In those
files are text such as "Chávez", where the acute-a is html
encoded.
After processing with a stylesheet and XML::XSLT the text "Chávez"
becomes "Ch㡶z".
Is there a way to fix this with XML::XSLT? We would like to have the
result stay as "Chávez" or become "Chávez".
This is the stylesheet.
===========================================
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xslutput method="html" encoding="UTF-16"
cdata-section-elements="parag"/>
<xsl:template match="/">
<xsl:apply-templates select="//body" />
<xsl:apply-templates select="//infobox" />
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="divvy"><P><SPAN
CLASS="divvy"><xsl:apply-templates/></SPAN></P></xsl:template>
<xsl:template
match="infobox"><P><xsl:apply-templates/></P></xsl:template>
</xsl:stylesheet>
===========================================
Our test script is as follows.
===========================================
use XML::XSLT;
($xmlfile, $xslfile) = @ARGV;
my $parser = XML::XSLT->new ($xslfile, warnings => 1);
$parser->transform($xmlfile);
print $parser->toString;
$parser->dispose ();
===========================================
Any assistance is very much appreciated.
I am migrating a perl production system from Solaris to Linux. My
knowlege of Perl and processing of XML is brief.
The issue we have is that we need to process data files. In those
files are text such as "Chávez", where the acute-a is html
encoded.
After processing with a stylesheet and XML::XSLT the text "Chávez"
becomes "Ch㡶z".
Is there a way to fix this with XML::XSLT? We would like to have the
result stay as "Chávez" or become "Chávez".
This is the stylesheet.
===========================================
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xslutput method="html" encoding="UTF-16"
cdata-section-elements="parag"/>
<xsl:template match="/">
<xsl:apply-templates select="//body" />
<xsl:apply-templates select="//infobox" />
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="divvy"><P><SPAN
CLASS="divvy"><xsl:apply-templates/></SPAN></P></xsl:template>
<xsl:template
match="infobox"><P><xsl:apply-templates/></P></xsl:template>
</xsl:stylesheet>
===========================================
Our test script is as follows.
===========================================
use XML::XSLT;
($xmlfile, $xslfile) = @ARGV;
my $parser = XML::XSLT->new ($xslfile, warnings => 1);
$parser->transform($xmlfile);
print $parser->toString;
$parser->dispose ();
===========================================
Any assistance is very much appreciated.