<?xml version="1.0" encoding="UTF-8"?>
<start>
<sort>
<first>1</first>
<country>chinese</country>
<town>邯郸</town>
<title>not anything</title>
</sort>
<sort>
<first>2</first>
<country>japanese</country>
<town>北海道</town>
<title>not anything</title>
</sort>
</start>
这么写 有错么? 我写的小测试。 总报错。不知道为什么。

解决方案 »

  1.   

    报这个错
    XML解析错误:未组织好 
    位置:http://localhost/demo/xml/sort.xml 
    行:6,列:9: <town>￿���</town>
      

  2.   

    噢,你是在解析的时候遇到了问题他不是有 encoding="UTF-8" 吗?那么文件就得保存为 utf-8 的
    如果保存成 gbk 的那么就得 encoding="gbk"总之字符集声明要与内容一致