<span id="query_with_namespace">查询带有命名空间的XML</span>
使用local-name函数,以此XML举例
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.huawei.daedalus</groupId>
<artifactId>daedalus-project</artifactId>
<version>1.2.2</version>
<packaging>pom</packaging>
</project>
要获取version节点值,则通过xpath:/*[local-name()='project']/*[local-name()='version']
获取