我需要一个Xpath表达式来选择以某个值开头的值。在本例中,我使用了id字段。
@id=[starts-with(name(),'value')
以下内容不起作用。有没有办法将starts with命令与标签之间的值一起使用?或者,在xpath中是否有另一种方法来选择与已知值匹配的值。
下面是我要深入研究的xml的一个示例:
<bean>
<id>AnnotationsBasedJMXAutoExporter</id>
<class>org.springframework.jmx.export.MBeanExporter</class>
<lazy-init>false</lazy-init>
<property>assembler
<!-- will create management interface using annotation metadata -->
<bean>
发布于 2013-05-17 19:36:07
我认为这个xpath应该可以在//id[starts-with(text(),'Annotations')]
中工作
https://stackoverflow.com/questions/16606883
复制相似问题