I want to add an attribute to the tag, using xmllint. Can I do this is through xmllint?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Xmllint in not made to edit XML, so I think the answer is “no, you can't”.
To edit XML, you can use XMLStarlet, the syntax to add an attribute into existing XML document is:
xmlstarlet ed -L -i xpath -t attr -n name -v value file