gpt4 book ai didi

xpath - 使用 XPath 访问 XML 中的注释

转载 作者:行者123 更新时间:2023-12-03 06:13:16 24 4
gpt4 key购买 nike

如何使用 XPath 访问 XML 文档中的注释?

例如:

<table>
<length> 12 </length>
<!--Some comment here-->
</table>

我想访问“此处的一些评论”。

谢谢...

编辑:我正在使用 MSXML DOM ActiveX 并且命令 comment() 似乎失败了...知道为什么吗?

最佳答案

带有路径

/foo/bar/comment()

您可以选择/foo/bar 元素中的所有注释。当然,可能取决于您选择的语言。但通常这就是您的做法。

关于xpath - 使用 XPath 访问 XML 中的注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/784745/

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