xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Theresa Jayne Forster" <ther...@inbrand.co.uk>
Subject Problem with foreign characters,
Date Thu, 08 Sep 2011 11:48:23 GMT
I have a minor issue and would like some help if I can,

Before I start there are a couple of pointers here.

1)      I cannot change the java code nor the version of FOP (modified 0.23)

2)      I have a partial resolution already in place

3)      I am just looking for the way to get the information I need.

 

I have code which scrapes a web page and rips out text turning it into the
downloadable pdf.

 

Some characters like é do not display correctly so I am doing a replace in a
template, 

I need to find what the characters are coming in as so I can convert them in
the replace, 

For instance the é character comes in as the character codes &#195;&#169;

How can I find the character codes coming in for all the other characters
(or convert them on the fly within xsl)

 

My template currently is as follows:

 

               <xsl:template name="loose_nasty_entities">

                                <xsl:param name="thisstring" select="."/>

 

                                <xsl:variable name="thisstring1">

                                                <xsl:call-template
name="replace">

 
<xsl:with-param name="str" select="$thisstring"/>

 
<xsl:with-param name="search-for" select="'&#226;&#8364;&#8220;'"/>

 
<xsl:with-param name="replace-with" select="'-'"/>

                                                </xsl:call-template>

                                </xsl:variable>

 

                                <xsl:variable name="thisstring2">

                                                <xsl:call-template
name="replace">

 
<xsl:with-param name="str" select="$thisstring1"/>

 
<xsl:with-param name="search-for" select="'&#239;&#187;&#191;'"/>

 
<xsl:with-param name="replace-with" select="''"/>

                                                </xsl:call-template>

                                </xsl:variable>

 

                                <xsl:variable name="thisstring3">

                                                <xsl:call-template
name="replace">

 
<xsl:with-param name="str" select="$thisstring2"/>

 
<xsl:with-param name="search-for" select="'&#194;'"/>

 
<xsl:with-param name="replace-with" select="''"/>

                                                </xsl:call-template>

                                </xsl:variable>

 

                                <xsl:variable name="thisstring4">

                                                <xsl:call-template
name="replace">

 
<xsl:with-param name="str" select="$thisstring3"/>

 
<xsl:with-param name="search-for" select="'&#195;&#169;'"/>

 
<xsl:with-param name="replace-with" select="'é'"/>

                                                </xsl:call-template>

                                </xsl:variable>                   

 

                                <xsl:variable name="thisstring5">

                                                <xsl:call-template
name="replace">

 
<xsl:with-param name="str" select="$thisstring4"/>

 
<xsl:with-param name="search-for" select="'&#195;&#8211;'"/>

 
<xsl:with-param name="replace-with" select="'&#214;'"/>

                                                </xsl:call-template>

                                </xsl:variable>                   

                                <xsl:value-of select="$thisstring5"/>

 

                </xsl:template>


 

Kindest regards

 


Theresa Forster

Senior Software Developer



 


Mime
View raw message