在XPath中指定namespace

来源:互联网 发布:淘宝卖家信用卡收费 编辑:程序博客网 时间:2024/06/07 23:08

<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']


参考链接