2017-10-06 46 views
0

此xmlstartlet更新适用于“ThreadGroup”,但不适用于“fooThreadGroup”如何在前面的字符串“ThreadGroup”中添加前缀通配符?如何将通配符添加到xmlstarlet更新

xmlstarlet ed --inplace --update '//ThreadGroup/longProp[@name="ThreadGroup.start_time"]' --value '1363247040000' "${xmlFile}" 
+0

是什么' “fooThreadGroup”'你的情况? – RomanPerekhrest

回答

0

由于xmlstarlet不支持ends-with()(因为这是XPath 2.0中),你必须这样做:

//*[self::ThreadGroup or self::fooThreadGroup]/longProp[@name="ThreadGroup.start_time"]