File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Change document format from UTF-8 to ISO-8859-1 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Change document format from UTF-8 to ISO-8859-1" Watch "Change document format from UTF-8 to ISO-8859-1" New topic
Author

Change document format from UTF-8 to ISO-8859-1

Mike Broadbear
Ranch Hand

Joined: Jan 14, 2002
Posts: 39
Hello,

I am creating an xml string, and posting it via http string.

I am trying to change:

<?xml version="1.0" encoding="UTF-8">

to:

<?xml version="1.0" encoding="ISO-8859-1">


How do I do this?

The packages I am using are:
org.w3c.dom.*
org.apache.xerces.dom

Can anyone help me accomplish this?

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

The DOM packages are only half of the equation. All they allow you to do is to parse an XML document into an internal format. The other half of the equation is a serializer, which allows you to serialize the internal format into an XML document. Here is where you would specify the encoding of the new document:
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Change document format from UTF-8 to ISO-8859-1
 
Similar Threads
XML Validation
Write XML to a file
Setting encoding in web.xml
change Encoding with Dom4J 1.1
Ansi encoding XML files?