Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用xmllint向标签添加一个属性。我可以通过 xmllint 做到这一点吗?
Xmllint 不是为了编辑 XML,所以我认为答案是“不,你不能”。
要编辑 XML,您可以使用 XMLStarlet,将属性添加到现有 XML 文档的语法是:
xmlstarlet ed -L -i xpath -t attr -n name -v value file