Xml 代码不能编译 请问哪里有错误

来源:百度知道 编辑:UC知道 时间:2024/06/04 04:25:49
<Student>
<Name>周跌路径</Name>
<Age>20</Age>
<Hobby>唱歌</Hobby>
<Name>周跌路径</Name>
<Age>30</Age>
<Hobby>武打性</Hobby>
</Student>

提示有错误
文本内容中发现无效字符。处理资源 'file:///C:/Documents and Settings/wodesiyou/桌面/ZuoYe.xml' 时出错。第 2 行,位置: 7

<Name>

最头上加上
<?xml version="1.0" encoding="GB2312" ?>


我已经可以调试成功了。。

如下:
<?xml version="1.0" encoding="GB2312"?>
<Student>
<Name>周跌路径</Name>
<Age>20</Age>
<Hobby>唱歌</Hobby>
<Name>周跌路径</Name>
<Age>30</Age>
<Hobby>武打性</Hobby>
</Student>