8

I want to add an attribute to the tag, using xmllint. Can I do this is through xmllint?

1 Answer 1

13

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

Sign up to request clarification or add additional context in comments.

1 Comment

It can be done with xmllint as shown in this answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.