问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/11696424/insert-xml-from-one-file-into-another-with-xmlstarlet