使用xmlstarlet将XML从一个文件插入另一个文件?

时间:2021-03-10 15:43:23

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?

有没有办法使用xmlstarlet将XML从一个文件插入到另一个文件中,或者我将一串-s命令串在一起?我有一个相当大的插入块。我会更好地写一些带有那个块的xsl吗?

1 个解决方案

#1


1  

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

我会更好地写一些带有那个块的xsl吗?

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.

我认为你最好使用XSL; document()函数允许您从另一个文件中获取XML。 xmlstarlet的ed子命令无法访问document(),并且缺少访问其他文件的方法。

#1


1  

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

我会更好地写一些带有那个块的xsl吗?

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.

我认为你最好使用XSL; document()函数允许您从另一个文件中获取XML。 xmlstarlet的ed子命令无法访问document(),并且缺少访问其他文件的方法。