如何使用xmlstarlet更新字符串属性? [英] How do I update a string attribute with xmlstarlet?

查看:101
本文介绍了如何使用xmlstarlet更新字符串属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ xmlstarlet edit -L -u "/parse-plugins/mimeType/plugin[@id='parse-html']/@id" -v 'parse-tika' conf/parse-plugins.xml

为什么不替换当前使用parse-的mimetpes插件ID html插件?

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

来自 xmlstarlet文档


属性的更新值

Update value of an attribute

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

我正在使用 nutch parse-plugins.xml

推荐答案

正如Mark指出的那样,它有效!要检查是否已更改,请使用

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.

这篇关于如何使用xmlstarlet更新字符串属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆