VSr*_*VSr 1 xslt saxon xslt-2.0 xslt-1.0
我有文件夹/子文件夹中的文件列表.如何运行单个XSLT来运行文件夹/子文件夹中的所有文件.是否可以在saxon命令行中使用?
我已经尝试过以下命令,但它不起作用:
java -jar saxon9.jar -o:foldername -xsl:xslfilename.xsl
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助.
由于您使用的是Saxon,因此您可以使用xslt 2.0和该collection函数.
例如:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="collection(concat('file:///c:/filesarehere', '?select=*.xml;recurse=yes'))">
<!--process nodes-->
</xsl:for-each>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)