`
wobfei
  • 浏览: 146984 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

The element type "xxx" must be terminated by the matching end-tag 解决

阅读更多

查看系统日志时,发现读取xml 流时抛出了“The element type "description" must be terminated by the matching end-tag "</description>". Nested exception”错误。

 

查看对应url的流内容,如下

	<?xml version="1.0" encoding="gb2312" ?>
	<goods>
		<ID>ebb1fb1f-80c2-493a-bced-0a07ef28fcd5</ID>
		<title>大大声</title>
		<description>大叔大叔的</description>
		<price>3.00</price><totalNumber>1</totalNumber>
		<sign>d813eab3585e8559d6e12604818588ee</sign>
	</goods>

 

手工检查感觉应没有问题,使用本地eclipse进行debug调试,发现可以成功解析。

 

经过排查最终发现。使用eclipse与使用服务器的默认编码格式不一致。。即使用eclipse时默认是UTF-8的,可以将内容成功解析。。

 

解决方法是:将xml中的encoding修改为utf-8,按照指定的encodeing进行解析就可以了。

分享到:
评论
1 楼 xiehaibin 2014-06-25  
传数据之前就要编码转换,转成utf-8再传就没有问题了

相关推荐

    s30801.tsr.zip_TSR_The Element

    The element type "name" must be terminated by the matching end-tag "&lt;/name&gt;".

    java调用net开发的webservice实例

    Caused by: org.xml.sax.SAXParseException: The element type "p" must be terminated by the matching end-tag "&lt;/p&gt;". at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at...

    accounts-es.json

    练习es的资源,注意如果导入报错,处理报错The bulk request must be terminated by a newline 的话 curl -XPOST -H 'Content-Type:application/json' '*:9200/bank/account/_bulk?pretty' --data-binary "@account....

    应用Dephi 开发佳能照相机API

    When using the EDSDK libraries, you must call this API once before using EDSDK APIs. Parameters: In: None Out: None Returns: Returns EDS_ERR_OK if successful. In other cases, see EDSDKError....

    keil安装过程及其一些问题解决

    无论是哪个版本,安装过程是相同的,该资源以V4.23为例 运行mdk.exe准备安装MDK-ARM

    数位板压力测试

    While the tablet interface design must address the technical problems stated above, it must also be useful to the programmers who will write tablet programs, and ultimately, to the tablet users....

    Senfore_DragDrop_v4.1

    The define *must* be made in the project options. It is not sufficient to #define it in the source. If you manage to compile with C++ Builder (any version), I would very much like to know about it...

    Universal-USB-Installer

    on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who ...

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

    Python库 | ansys-mapdl-reader-0.51.3.tar.gz

    python库。 资源全名:ansys-mapdl-reader-0.51.3.tar.gz

    keil4 Error: User Command terminated, Exit-Code=1

    今天我的朋友用了我发给他的文件后总是显示 Error: User Command terminated, Exit-Code = 1,在我这边又可以显示ok,排查了一下原因和网上的资料之后在这里做一下总结。

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

    The Art of Assembly Language Programming

    The 80x86 MOV Instruction 4.8 - Some Final Comments on the MOV Instructions &lt;br&gt;4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 ...

    hibernate-shards.jar

    on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who ...

    gun tar for windows

    -r, --append append files to the end of an archive -u, --update only append files newer than copy in archive -A, --catenate append tar files to an archive --concatenate same as -A --delete delete...

    TPFanControl 0.63准绿色版+教程

    // Save the icon by a start delay of the program/service of // "SecStartDelay" (sec.) within "SecWinUptime" (sec.) after (re)boot // Delete slashes '//' at next 3 parameters. // 在启动或重启后,设定...

    Recover4all Professional

    computer for each one (1) purchased license the Registration Key may not be saved and the Registered Software may not be used on any other computer by the Registered End User or anybody else, unless a...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    Each command is terminated with an end-of-line terminator which can be either a carriage-return &lt;c/r&gt; or line feed &lt;l/f&gt;. For RS-232 models, the baud rate and terminator character are selected using ...

    WizFlow网页编辑

    on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who ...

    TA-Lib-0.4.19.tar.gz

    python TA-lib包

Global site tag (gtag.js) - Google Analytics