Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> oracle xsl convertion to utf-8

oracle xsl convertion to utf-8

From: <reynard.michel_at_gmail.com>
Date: 13 Jun 2006 08:23:14 -0700
Message-ID: <1150212194.178205.61720@u72g2000cwu.googlegroups.com>


I've to translate an ISO xml file in utf-8. For this I used a XSL file that work fine with xmlspy.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

                <xsl:value-of select="'&lt;!DOCTYPE rsv PUBLIC &quot;-//IWARE//DTD rsv atelier//FR//XML&quot;
&quot;http://www.rsv.vd.ch/rsv.dtd&quot;&gt;'" disable-output-escaping="yes"/>

		<xsl:apply-templates/>

</xsl:template>

<xsl:template match="node() | @*">
<xsl:copy> <xsl:apply-templates select="node() | @*"/> </xsl:copy>
</xsl:template>

</xsl:stylesheet>

If I use oracle.xml.parser.v2 for the job it doesen't work, the data aren't utf-8

The I tried to use following (xml is sored in the baos)

ByteArrayOutputStream baos = new ByteArrayOutputStream(); ....
String content = baos.toString("UTF-8");

Still no luck
Finally I used some replace functions

content.replaceAll("à",new Character((char)0xC3).toString() + new Character((char)0xA0).toString());
content.replaceAll("â",new Character((char)0xC3).toString() + new Character((char)0xA2).toString());
....

That works fine but I'm sure that there is something better. Any idea?

Michel Received on Tue Jun 13 2006 - 10:23:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US