Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a pipe-friendly program that takes:

  • An XML document
  • An XPath expression indicating the target element(s)
  • The desired replacement

? Something like sed but knowledgeable about XML (elements, whitespace, etc.)?

share|improve this question

If you don't mind using/learning XSLT, there is the xsltproc utility which can accomplish this.

share|improve this answer

XMLSH has a command xed that might fit your parameters.

xed evaluate an xpath expression and edits every matching node outputing the result document

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .