2017-10-06 55 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"]