Add an attribute using xmllint

与世无争的帅哥 提交于 2020-01-01 09:49:15

问题


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



来源:https://stackoverflow.com/questions/6404277/add-an-attribute-using-xmllint

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!