我正在寻找一个 XPATH 表达式,它将执行搜索以确保字段中没有字母。例如输入 XML:
<?xml version="1.0" encoding="UTF-8"?>
<payload>
<records>
<record>
<number>123</number>
</record>
<record>
<number>456</number>
</record>
<record>
<number>78A</number>
</record>
</records>
</payload>
我希望它也过滤掉第三个结果,因为它在标签中有一个字母。所以返回这个:
<?xml version="1.0" encoding="UTF-8"?>
<payload>
<records>
<record>
<number>123</number>
</record>
<record>
<number>456</number>
</record>
</records>
</payload>
可以在简单的 XPATH 中做到这一点吗?
所以像/payload/records/record[reg expression here?]
@Cylian
这就是我的意思:
<?xml version="1.0" encoding="UTF-8"?>
<payload>
<records>
<record>
<number>123</number>
<time>12pm</time>
<zome>UK</zome>
</record>
<record>
<number>456</number>
<time>12pm</time>
<zome>UK</zome>
</record>
<record>
<number>78A</number>
<time>12pm</time>
<zome>UK</zome>
</record>
</records>
</payload>