(XML)根元素后面的文档中的标记必须格式正确 开始位置:6:2

刚刚开始在我的XML类中,找到一个解决我的错误有点麻烦。我得到这个错误:“根元素后面的文档中的标记必须格式正确。
开始位置:6:2“。

任何一种提示或帮助都会很棒。

<?xml version="1.0" encoding="UTF-8"?>
 <heading>
 The Twelve Days of Christmas
 </heading>

<song> //OxyGen highlights "<song>" as the error,but i'm not sure I understand.
    <Day ="One"> 
        <verse>
    On the first day of Christmas,my true love sent to me,a partridge in a pear tree.
        </verse>
    </Day>

    <Day="Two">
        <verse>
     On the second day of Christmas,my true love sent to me 
     Two turtle doves 
     and a partridge in a pear tree. 
        </verse>
    </Day>

     <Day="Three"> 
         <verse>
     On the third day of Christmas,my true love sent to me 
     Three French hens,two turtle doves 
     And a partridge in a pear tree.
         </verse>
     </Day>

     <Day="Four">
         <verse>
     On the fourth day of Christmas,my true love sent to me 
     Four calling birds,three French hens,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Fifth">
         <verse>
     On the fifth day of Christmas,my true love sent to me 
     Five golden rings. 
     Four calling birds,two turtle doves 
     And a partridge in a pear tree.
         </verse>
     </Day>

     <Day="Sixth">
         <verse>
     On the sixth day of Christmas,my true love gave to me 
     Six geese a-laying,Five golden rings. 
     Four calling birds,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Seventh">
         <verse>
     On the seventh day of Christmas,my true love gave to me 
     Seven swans a-swimming,six geese a-laying,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Eighth">
         <verse>
     On the eighth day of Christmas,my true love gave to me 
     Eight maids a-milking,seven swans a-swimming,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Ninth">
         <verse>
     On the ninth day of Christmas,my true love gave to me 
     Nine ladies dancing,eight maids a-milking,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Tenth">
         <verse>
     On the tenth day of Christmas,my true love gave to me 
     Ten lords a-leaping,nine ladies dancing,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Eleventh">
         <verse>
     On the eleventh day of Christmas,my true love gave to me 
     Eleven pipers piping,ten lords a-leaping,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

     <Day="Twelfth">
         <verse>
     On the twelfth day of Christmas,my true love gave to me 
     Twelve drummers drumming,eleven pipers piping,two turtle doves 
     And a partridge in a pear tree. 
         </verse>
     </Day>

 </song>
在XML中只能有一个根元素 – 你有两个标题和歌曲。

如果你重组的东西像:

<?xml version="1.0" encoding="UTF-8"?>
<song> 
 <heading>
 The Twelve Days of Christmas
 </heading>
 ....
</song>

根层次上格式良好的XML的错误应该消失(尽管可能还有其他问题)。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类
XML入门的常见问题(二)
Java对象的强、软、弱和虚引用
JS解析XML文件和XML字符串详解
java中枚举的详细使用介绍
了解Xml格式
XML入门的常见问题(四)
深入SQLite多线程的使用总结详解
PlayFramework完整实现一个APP(一)
XML和YAML的使用方法
XML轻松学习总节篇