无效的XML文件? [英] invalid XML file?

查看:220
本文介绍了无效的XML文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2008中将以下文件作为新的XML文件编写,并且报告了以下错误.错误消息是什么?为什么将其视为格式错误的XML文件?

I wrote the following file in Visual Studio 2008 as a new XML file, and it reports the following error. What is the error message about and why it is treated as a wrong format XML file?

这是XML文件和相关的错误消息.

Here is the XML file and related error message.

<?xml version="1.0" encoding="utf-8"?>
<Foo>&#x2;</Foo>

Error   1   Character ' ', hexadecimal value 0x2 is illegal in XML documents.   XMLFile1.xml    2   6   Miscellaneous Files

感谢您的到来, 乔治

推荐答案

您的问题是对&#x02的引用,它实际上是无法打印的随机二进制数据.在XML1.0中(在XML 1.1及更高版本中,这是不允许的,但是即使更改XML版本,也不确定您的.Net版本是否允许).

Your problem is the reference to &#x02, which essentially is random binary data that can not be printed. This is not allowed in XML1.0 (it is in XML 1.1 and higher, but it's not certain that your .Net version will allow it even if you change XML versions).

这篇关于无效的XML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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