<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; CHARSET=UTF-8" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=宋体 size=2>
<DIV>Dear ben</DIV>
<DIV> </DIV>
<DIV>The following are the xml and java file,my problem still
exists.........</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>exampleA.xml</FONT></DIV>
<DIV><FONT size=2><?xml version="1.0" encoding="UTF-16"?></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><bookList></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> <book></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<name>方法</name></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<author>333</author></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<publishDate>2002-6-6</publishDate></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<price>35.0</price></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> </book></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2></bookList></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>import org.jdom.*;</FONT></DIV>
<DIV><FONT size=2>import org.jdom.output.*;</FONT></DIV>
<DIV><FONT size=2>import org.jdom.input.*;</FONT></DIV>
<DIV><FONT size=2>import java.io.*;<BR>import java.net.*;<BR>import
org.xml.sax.*;</FONT><FONT size=2><BR>public class SaxParser {<BR>
public static void main(String[] argv) {</DIV>
<DIV> </DIV>
<DIV> SAXBuilder sb = new SAXBuilder();<BR>
String tt= "";<BR>
try{<BR> File file =new
File("exampleA.xml");<BR> Reader rdr =
new FileReader(file);<BR> long
sz=file.length();<BR> char[] ch =new
char[(int)sz];<BR>
rdr.read(ch);<BR>
rdr.close();<BR> tt=new
String(ch);<BR> }</DIV>
<DIV> </DIV>
<DIV> catch(Exception
e){<BR>
e.printStackTrace();<BR>
}<BR>
System.out.println(tt);<BR>
StringReader sr=new StringReader(tt);</DIV>
<DIV><BR> Document
doc=null;<BR>
try{<BR> doc =
sb.build(sr);<BR>
}<BR> catch(JDOMException
e){<BR> e.printStackTrace()
;<BR>
System.out.println(e.getMessage()
);<BR> }<BR>
}<BR>}</FONT></DIV></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 9pt 宋体">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 9pt 宋体; font-color: black"><B>From:</B>
<A href="mailto:benjamin.kopic@pancontext.com"
title=benjamin.kopic@pancontext.com>Benjamin Kopic</A> </DIV>
<DIV style="FONT: 9pt 宋体"><B>To:</B> <A href="mailto:alexdingdang@hotmail.com"
title=alexdingdang@hotmail.com>alex</A> </DIV>
<DIV style="FONT: 9pt 宋体"><B>Sent:</B> Tuesday, April 01, 2003 6:10 PM</DIV>
<DIV style="FONT: 9pt 宋体"><B>Subject:</B> Re: [jdom-interest] StringReader and
Unicode char</DIV>
<DIV><BR></DIV>alex, just off top of my head, do you use 'UTF-16' or
'UTF-8' in your xml string? if nothing is specified, then jdom assumes that
the encoding is 'UTF-8', which might be your problem.<BR><BR>best
regards<BR><BR>ben<BR><BR><BR></BLOCKQUOTE></BODY></HTML>