使用 Location 对象插入 XMLEvent

发布于 2024-12-17 13:16:18 字数 145 浏览 2 评论 0原文

有没有办法在使用 XMLEventReader 读取的另一个 XMLEvent 位置处使用 XMLEventWriter 写入 XMLEvent

谢谢,

Is there a way to write XMLEvent using XMLEventWriter at the location of another XMLEvent read using XMLEventReader?

Thanks,

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

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

发布评论

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

评论(1

﹉夏雨初晴づ 2024-12-24 13:16:19

据我所知,您无法使用 XMLReader 就地编辑 XML 文件。您可以通过将所有事件从 XMLReader 直接发送到 XMLWriter 来将整个 XML 复制到输出文件(或流)。然后,您可以动态创建自己的 XMLEvent 并在适当的时间将它们提供给 XMLWriter,它们将显示在新文档中。

As far as I know, you cannot edit an XML file in-place using XMLReader. You can copy the entire XML to an output file (or stream) by sending all events from an XMLReader directly to an XMLWriter. You can then create your own XMLEvents on the fly and feed them to the XMLWriter at the appropriate time and they will show up in the new document.

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