我使用xsltproc
实用程序将多个xml测试结果转换为使用类似以下命令的漂亮的打印控制台输出。xsltproc在多个文件之前和之后添加文本
xsltproc stylesheet.xslt testresults/*
凡stylesheet.xslt
看起来是这样的:
<!-- One testsuite per xml test report file -->
<xsl:template match="/testsuite">
<xsl:text>begin</xsl:text>
...
<xsl:text>end</xsl:text>
</xsl:template>
这给我类似这样的输出:
begin
TestSuite: 1
end
begin
TestSuite: 2
end
begin
TestSuite: 3
end
我想是这样的:
begin
TestSuite: 1
TestSuite: 2
TestSuite: 3
end
谷歌搜索是T.掏空。我怀疑我可能能够以某种方式合并xml文件,然后我将它们提供给xsltproc
,但我希望获得更简单的解决方案。