gpt4 book ai didi

c++ - Pugixml:找不到文档元素

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

我在 pugixml 中加载文档(参见链接 http://pastebin.com/FE3nDX9h)时遇到了一些问题。
我收到错误代码 16:No document element found 这表明 XML 文件无效或为空,我认为两者都不是。
我正在使用默认的解析方法。有什么我想念的吗?

编辑:根据要求,这是一些源代码 http://pastebin.com/USUjLC4q您将需要编辑路径。

最佳答案

您需要 xml_document::load_filexml_document::load

From pugi documentation :

There is also a simple helper function, xml_document::load, for cases when you want to load the XML document from null-terminated character string.

因此,load 的参数本身必须是 xml,而不是文件名。

关于c++ - Pugixml:找不到文档元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24549737/

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