ujs_lifazhu 2013-04-07 15:27
浏览 503
已采纳

为什么用xom 转换xml时报异常nu.xom.IllegalCharacterDataException: 0x12 is not allowed

用xom 转换 json 为xml时报异常nu.xom.IllegalCharacterDataException: 0x12 is not allowed in

异常信息如下
[code="java"]
nu.xom.IllegalCharacterDataException: 0x12 is not allowed in XML content
at nu.xom.Verifier.throwIllegalCharacterDataException(Verifier.java:154)
at nu.xom.Verifier.checkPCDATA(Verifier.java:205)
at nu.xom.Text._setValue(Text.java:126)
at nu.xom.Text.(Text.java:62)
at nu.xom.Element.appendChild(Element.java:1069)
at net.sf.json.xml.XMLSerializer.processJSONValue(XMLSerializer.java:993)
at net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:953)
at net.sf.json.xml.XMLSerializer.processJSONValue(XMLSerializer.java:1003)
at net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:953)
at net.sf.json.xml.XMLSerializer.processJSONValue(XMLSerializer.java:1003)
at net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:953)
at net.sf.json.xml.XMLSerializer.write(XMLSerializer.java:593)
at com.njjh.util.Util.getXMLFromJSON(Util.java:793)
at com.njjh.servlet.Information.service(Information.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)

[/code]

为什么呢,大神!!!!

  • 写回答

1条回答 默认 最新

  • bewithme 2013-04-07 16:21
    关注

    表明显你用到了非法的字符,0x12 ,你需要用转义字符来做转义。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化