<?xml version="1.0" encoding="UTF-8"?>
<type id = "player"/>
<type id = "spider"/>
<type id = "spider"/>第二行处报错误:
“The up in the document following the root element must be well-formed.”
但如果文件时这样:
<?xml version="1.0" encoding="UTF-8"?>
<type id = "player"/>
就不会报错。请问,为什么会有这个错误?如何更改?
<type id = "player"/>
<type id = "spider"/>
<type id = "spider"/>第二行处报错误:
“The up in the document following the root element must be well-formed.”
但如果文件时这样:
<?xml version="1.0" encoding="UTF-8"?>
<type id = "player"/>
就不会报错。请问,为什么会有这个错误?如何更改?
解决方案 »
- ByteArrayOutputStream的toByteArray();方法
- 在java中如何在一张图片上添加按钮控件?
- could not find the main class.Program will exit.错误
- 怎样在面板中,画动态的波形!! 急 !
- 对基本语句for,if,break等的问题
- 还是Runtime问题请教!!!
- java2中关于文件的小问题,请ggjj不吝赐教!
- 有关Applet启动时的问题?请大虾帮忙
- 在JCreator pro里编译HelloWorld是出现这个错误,为什么?
- 愿送100分,有谁能解释这幅图的关系及意思?
- 饿汉式单例模式为什么是线程安全的
- java操作pdf模板自动生成pdf文件
<root>
<type id = "player"/>
<type id = "spider"/>
<type id = "spider"/>
</root>
XML 文档只能有一个顶层元素,也就是根结点。
<?xml version="1.0" encoding="UTF-8"?>
<type id = "player"/>
<type id = "spider"/>
<type id = "spider"/>
你这样写,就有多个相同的根结点,肯定会错。<?xml version="1.0" encoding="UTF-8"?>
<type id = "player"/>
这样写就一个根结点type,肯定不会报错了。问题解决了,记得结贴!