Add an attribute using xmllint
Asked Answered
A

1

8

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

Ainsworth answered 19/6, 2011 at 18:21 Comment(0)
H
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

Hanshansard answered 19/6, 2011 at 19:1 Comment(1)
It can be done with xmllint as shown in this answerEnglacial

© 2022 - 2024 — McMap. All rights reserved.