当前位置: 代码迷 >> J2SE >> xml读取有关问题,大神帮忙!
  详细解决方案

xml读取有关问题,大神帮忙!

热度:269   发布时间:2016-04-24 01:39:36
xml读取问题,大神帮忙!!!!!
XML code
<?xml version="1.0" encoding="UTF-8"?><users>    <user id="1">        <uid>M@LD@MLEEDFAELBBACD@FFMGDFGFCEBMAGE</uid>        <key>EGDBGEMMB@L@BGDCEDMLD@BL@GFE@</key>    </user></users>


以上是xml源码,求大神帮解析出uid和key两个标签内容,我解析时遇到问题,不知怎么处理
Java code
[Fatal Error] smsUsers.xml:4:8: An invalid XML character (Unicode: 0x10) was found in the element content of the document.org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x10) was found in the element content of the document.    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)    at com.bianfeng.sms.Account.loadProperties(Account.java:34)    at com.bianfeng.sms.Account.<clinit>(Account.java:22)java.lang.ExceptionInInitializerError



如果能给出代码,万分感谢,由于特殊原因,xml字符不能修改

------解决方案--------------------
uid 和 key里有xml无法识别的字符 所以乱码
------解决方案--------------------
<![CDATA[...]]>
  相关解决方案