Search code examples
xmlinsertxmlstarlet

Insert XML from one file into another with xmlstarlet?


Is there a way to insert XML from one file into another using xmlstarlet or am I stuck stringing together a bunch of -s commands? I have a fairly large chunk to insert. Would I be better off writing some xsl with that chunk in it?


Solution

  • Would I be better off writing some xsl with that chunk in it?

    I think you would be better off using XSL; the document() function lets you get XML from another file. xmlstarlet's ed subcommand doesn't have access to document() and it lacks a way of accessing other files.