开发者

How do I update a string attribute with xmlstarlet?

开发者 https://www.devze.com 2023-02-28 20:42 出处:网络
$ xmlstarlet edit -L -u \"/parse-plugins/mimeType/plugin[@id=\'parse-html\']/@id\" -v \'parse-tika\' conf/parse-plugins.xml
$ xmlstarlet edit -L -u "/parse-plugins/mimeType/plugin[@id='parse-html']/@id" -v 'parse-tika' conf/parse-plugins.xml

Why doesn't it replace the plugin id of mimetpes currently using parse-html plugin?

From xmlstarlet documentation:

Update开发者_JAVA技巧 value of an attribute

xml ed -u ’/xml/table/rec[@id=3]/@id’ -v 5 xml/tab-obj.xml

I'm working on nutch parse-plugins.xml.


as Mark pointed out, it works! To check that things changed use

$ xmlstarlet sel -t -c "/parse-plugins/mimeType/plugin[@id='parse-html']" conf/parse-plugins.xml

or the last-modified file attribute.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号