错误:“根级别的数据无效。第1行,第1位“而。 [英] Error: "Data at the root level is invalid. Line 1, position 1 " while.

查看:110
本文介绍了错误:“根级别的数据无效。第1行,第1位“而。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取

根级别的数据 无效。行 1 ,位置 1  

通过传递xml作为输入将结果插入数据库存储过程。



如果xml数据中包含'&'字符,则会发生这种情况。



请回复.. ??

解决方案

参考 - XML规范 [ ^ ]

Quote:

&符号(&)和左尖括号(< )仅在用作标记分隔符时,或在注释,处理指令或CDATA部分中时,才可以以字面形式出现。如果在别处需要它们,则必须使用数字字符引用或字符串& amp;对它们进行转义。和& lt;分别


Getting

Data at the root level is invalid. Line 1, position 1

while insertion result in database by passing xml as input to stored procedure.

It happens iff xml data contains '&' character in it.

Please reply..??

解决方案

Refer - XML Specification[^]

Quote:

The ampersand character (&) and the left angle bracket (<) may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings "&amp;" and "&lt;" respectively.


这篇关于错误:“根级别的数据无效。第1行,第1位“而。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆