Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] converting charset

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Luca Passani'" <passani AT eunet.no>, "'xom-interest'" <xom-interest AT lists.ibiblio.org>
  • Cc:
  • Subject: RE: [XOM-interest] converting charset
  • Date: Mon, 30 May 2005 10:25:40 +0100

>
> can I use XOM to convert from one charset into another one?
>
> say windows to ISO-8859.....
>

Probably yes, but you can do this without actually constructing a tree
representation of the document. You should be able to do it with a simple
JAXP identity transformation:

Transformer t = TransformerFactory.newTransformer();
t.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
t.transform(new StreamSource(inputfile), new StreamResult(outputfile));

(The Saxon implementation of this won't build a tree. I can't speak for the
Xalan implementation.)

Michael Kay
http://www.saxonica.com/






Archive powered by MHonArc 2.6.24.

Top of Page