Skip to content
Advertisement

How do I append or prepend to an attribute in an xml file using xmlstarlet or similar?

Did not see it in the docs. Here’s what I’m trying to do:

JavaScript

I want to pre-append the prefix 1_ to t.

Expected Output:

JavaScript

Actual Output:

JavaScript

Advertisement

Answer

Try this:

JavaScript

-v is for fixed values, -x is for xpath expressions.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement