为什么 XML 文档必须有一个根元素? [英] Why must XML documents have a single root element?
本文介绍了为什么 XML 文档必须有一个根元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
决定在 XML 文档中使用单个根元素的动机是什么?
What is the motivation behind the decision to have a single root element in an XML document?
有人可以解释为什么 XML 设计团队做出这个决定吗?
Could someone explain why the XML design team made this decision?
推荐答案
如 XML 规范中所述:
定义:只有一个元素,称为根元素或文档元素,它的任何部分都不会出现在任何其他元素的内容中.[...] 由开始和结束标签分隔的元素相互嵌套.
Definition: There is exactly one element, called the root, or document element, no part of which appears in the content of any other element. [...] The elements, delimited by start- and end-tags, nest properly within each other.
这篇关于为什么 XML 文档必须有一个根元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文