<s:test xmlns:s="http://www.ca.com/" xmlns:a="http://www.w3.org/1999/xhtml">
<a:child>abc</a:child>
</s:test>如果要解析上面的XML,需要如下指定XPath:
/*[local-name() = 'test' and namespace-uri() = 'http://www.ca.com/']/*[local-name() = 'child' and namespace-uri() = 'http://www.w3.org/1999/xhtml']
本文介绍了一种特定格式的XML文档,并展示了如何使用XPath表达式来精确地定位和获取XML文档中的元素。通过实例说明了跨命名空间的XPath选择方法。
384

被折叠的 条评论
为什么被折叠?



