将许多xml文件合并为一个大文件 [英] Combine many xml files into one big file

查看:109
本文介绍了将许多xml文件合并为一个大文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Doxygen xml输出发送到graphviz,但是我有超过1000多个xml文件要组合,而且我不知道如何在Windows上执行此操作.一旦将其安装在一个文件中,我就为XSLT处理安装了Saxon,但是我不知道如何组合这些文件.

I am trying to sent Doxygen xml output to graphviz but I have over 1000+ xml files to be combined and I do not know how to do this on windows. I have Saxon installed for the XSLT processing once it is all in one file, but I don't know how to combine the files.

据我了解,我的管道将如下所示:

My pipeline as I understand it will go like this:

Doxygen XML输出->合并到单个XML(如何)->通过撒克逊人(Saxon)进行XSLT处理->转换为DOT->通过graphviz输出->派对

Doxygen XML output -> Merge to single XML (how) -> XSLT process via Saxon -> Convert to DOT -> output via graphviz -> Party

Doxygen已输出XML,在合并 java -jar c:\ saxon \ saxon9he.jar -s:myinput.xml -xsl:myxslt.xslt -o:myoutput.xml后,我有一个使用saxon的命令,还有无穷无尽的DOT转换实用程序.但是您如何合并数百个XML文件?

Doxygen has output the XML, I have a command for using saxon after merging java -jar c:\saxon\saxon9he.jar -s:myinput.xml -xsl:myxslt.xslt -o:myoutput.xml, and there are endless utilities for DOT conversion. But how do you merge hundreds of XML files?

我可以运行批处理文件/脚本或python脚本或Windows程序命令作为解决方案.我正在寻找可以在连续管道中工作的东西,以供将来使用另一组可能数百个文件的文件.我的最终目标是打印出由graphviz创建的大型图表,以替代UML映射,这很难找到解决方案(Doxygen正在读取C代码).

I can run batch files/scripts or python scripts or commands of windows programs as a solution. I'm looking for something that works in a continuous pipeline for future use of another set of possibly several hundred files. My ultimate goal is to print out the large chart created from graphviz as an alternate to UML mapping which was hard enough to find a solution for (Doxygen is reading C code).

推荐答案

使用XPath collection()函数.您可以按照建议在管道的单独步骤中进行合并,也可以将其合并到主样式表中.例如:

Use the XPath collection() function. You can either do the merging in a separate step in your pipeline as you suggest, or you can incorporate it into your main stylesheet. For example:

<xsl:variable name="merged">
  <xsl:copy-of select="collection('file:///c:/data/dir/?select=*.xml;recurse=yes')"/>
</xsl:variable>

这篇关于将许多xml文件合并为一个大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆