(XML)根元素后面的文档中的标记必须格式正确。出发地点:6:2 [重复]

前端之家收集整理的这篇文章主要介绍了(XML)根元素后面的文档中的标记必须格式正确。出发地点:6:2 [重复]前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > How to fix error: The markup in the document following the root element must be well-formed1个答案刚刚开始我的XML类,并找到我的错误解决方案有点麻烦。我收到此错误:“根元素后面的文档中的标记必须格式正确。
开始位置:6:2“。

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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <heading>
  3. The Twelve Days of Christmas
  4. </heading>
  5.  
  6. <song> //OxyGen highlights "<song>" as the error,but i'm not sure I understand.
  7. <Day ="One">
  8. <verse>
  9. On the first day of Christmas,my true love sent to me,a partridge in a pear tree.
  10. </verse>
  11. </Day>
  12.  
  13. <Day="Two">
  14. <verse>
  15. On the second day of Christmas,my true love sent to me
  16. Two turtle doves
  17. and a partridge in a pear tree.
  18. </verse>
  19. </Day>
  20.  
  21. <Day="Three">
  22. <verse>
  23. On the third day of Christmas,my true love sent to me
  24. Three French hens,two turtle doves
  25. And a partridge in a pear tree.
  26. </verse>
  27. </Day>
  28.  
  29. <Day="Four">
  30. <verse>
  31. On the fourth day of Christmas,my true love sent to me
  32. Four calling birds,three French hens,two turtle doves
  33. And a partridge in a pear tree.
  34. </verse>
  35. </Day>
  36.  
  37. <Day="Fifth">
  38. <verse>
  39. On the fifth day of Christmas,my true love sent to me
  40. Five golden rings.
  41. Four calling birds,two turtle doves
  42. And a partridge in a pear tree.
  43. </verse>
  44. </Day>
  45.  
  46. <Day="Sixth">
  47. <verse>
  48. On the sixth day of Christmas,my true love gave to me
  49. Six geese a-laying,Five golden rings.
  50. Four calling birds,two turtle doves
  51. And a partridge in a pear tree.
  52. </verse>
  53. </Day>
  54.  
  55. <Day="Seventh">
  56. <verse>
  57. On the seventh day of Christmas,my true love gave to me
  58. Seven swans a-swimming,six geese a-laying,two turtle doves
  59. And a partridge in a pear tree.
  60. </verse>
  61. </Day>
  62.  
  63. <Day="Eighth">
  64. <verse>
  65. On the eighth day of Christmas,my true love gave to me
  66. Eight maids a-milking,seven swans a-swimming,two turtle doves
  67. And a partridge in a pear tree.
  68. </verse>
  69. </Day>
  70.  
  71. <Day="Ninth">
  72. <verse>
  73. On the ninth day of Christmas,my true love gave to me
  74. Nine ladies dancing,eight maids a-milking,two turtle doves
  75. And a partridge in a pear tree.
  76. </verse>
  77. </Day>
  78.  
  79. <Day="Tenth">
  80. <verse>
  81. On the tenth day of Christmas,my true love gave to me
  82. Ten lords a-leaping,nine ladies dancing,two turtle doves
  83. And a partridge in a pear tree.
  84. </verse>
  85. </Day>
  86.  
  87. <Day="Eleventh">
  88. <verse>
  89. On the eleventh day of Christmas,my true love gave to me
  90. Eleven pipers piping,ten lords a-leaping,two turtle doves
  91. And a partridge in a pear tree.
  92. </verse>
  93. </Day>
  94.  
  95. <Day="Twelfth">
  96. <verse>
  97. On the twelfth day of Christmas,my true love gave to me
  98. Twelve drummers drumming,eleven pipers piping,two turtle doves
  99. And a partridge in a pear tree.
  100. </verse>
  101. </Day>
  102.  
  103. </song>
在XML中,只有一个根元素 – 你有两个 – 标题和歌曲。

如果您重组为以下内容

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <song>
  3. <heading>
  4. The Twelve Days of Christmas
  5. </heading>
  6. ....
  7. </song>

关于根级别上格式良好的XML的错误应该消失(尽管可能存在其他问题)。

猜你在找的XML相关文章