使用 xerces 将元素添加到 xml 文件

发布于 2024-08-18 06:55:40 字数 242 浏览 15 评论 0原文

我有一个名为 LOD.xml 的 xml 文件,该文件中有一个模型列表。

我想向此文件添加另一个 DomElement。我不想再次解析所有列表。我只想解析文件并获取 DomDocument 和 RootDomElement。

将新的 DomElement 附加到 RootDomElement 后,我​​想再次将 DomDocument 写入此文件。

你知道我该怎么做吗?

我使用 xerces 和 c++

i have an xml file named LOD.xml and in this file there is a list of models.

i want to add another DomElement to this file. i dont want to parse all the list again. i just want to parse file and get DomDocument and RootDomElement.

after appending my new DomElement to the RootDomElement, i want to write DomDocument to this file back again.

do you know how i can do this??

i use xerces and c++

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月染过的梦 2024-08-25 06:55:40

There is an article on XML serialization using Xerces-C++ on IBMs developerworks, LocalFileFormatTarget is what you are looking for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文