Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> oracle xsl convertion to utf-8
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="'<!DOCTYPE rsv PUBLIC "-//IWARE//DTD
rsv atelier//FR//XML"
"http://www.rsv.vd.ch/rsv.dtd">'"
disable-output-escaping="yes"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="node() | @*">
<xsl:copy> <xsl:apply-templates select="node() | @*"/> </xsl:copy>
</xsl:template>
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
![]() |
![]() |