【发布时间】:2011-05-07 13:25:00
【问题描述】:
你能指点我,下面的Xml文件有什么问题吗?
<?xml version="1.0" encoding="utf-8"?>
<root>
<align>right</align>
<columns>3</columns>
<rows>4</rows>
<backgroundColor>#333333</backgroundColor>
<circleButtonColor>#666666</circleButtonColor>
<currentCircleButtonColor>#000000</currentCircleButtonColor>
<textColor>#000000</textColor>
<thumbWidth>100</thumbWidth>
<thumbHeight>75</thumbHeight>
<thumbPadding>10</thumbPadding>
<thumbBorder>3</thumbBorder>
<thumbBorderColor>#0000F1</thumbBorderColor>
<assetWidth>600</assetWidth>
<assetHeight>400</assetHeight>
<showImageCaption>yes</showImageCaption>
<showImageShadow>no</showImageShadow>
<target>_self</target>
</root>
这是错误
Invalid at the top level of the document. Error processing resource 'http://www.example.com/xml/setup.xml'. Line 20, Positi...
</root>
我确信我可以使用中断,但如果我不这样做,在我上传特定文件之前,我在 localhost 上没有错误。
更新:检查 Xml(十六进制)后,我注意到在 </root> 之后神奇地添加了字符 0x00(NULL)
说神奇的是我的意思是......
XML 文件通常在本地主机上创建。 NULL 字符由自定义 FTP 类附加(用于上传 - 二进制模式),或者其他我无法想象的东西..
【问题讨论】:
-
XML 本身似乎没有任何错误。可能是你的代码有问题?
-
XML 很好;也许解析器需要一个 DOCTYPE 声明。
-
您是否截断了错误消息?如果是这样,为什么? Line 和 Position 告诉您(以及那些试图帮助您的人)实际问题出在哪里。
标签: asp.net xml ftp xmlhttprequest hex