gpt4 book ai didi

xml - 一个 XML 文档可以有多少个父节点?

转载 作者:数据小太阳 更新时间:2023-10-29 02:51:58 24 4
gpt4 key购买 nike

是否可以有不止一组父节点?

例子:

<?xml version="1.0" encoding="UTF-8" ?>
<parentOne>
<child>
<subChild></subChild>
</child>
</parentOne>
<parentTwo>
<child>
<subChild></subChild>
</child>
</parentTwo>

有没有办法解决这个问题?

最佳答案

简短回答:否。

每个 XML 文档都有 exactly one root element根据 standard .

[Definition: There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.] For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.

改用这样的东西:

<?xml version="1.0" encoding="UTF-8" ?>
<parents>
<parent id="One">
<child>
<subChild></subChild>
</child>
</parent>
<parent id="Two">
<child>
<subChild></subChild>
</child>
</parent>
</parents>

关于xml - 一个 XML 文档可以有多少个父节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8909580/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com