The many-to-one mojo performs XSL transformation of a set of source files into a single destination file as follows.
The names of the multiple source files are passed into the template as a pipe-separated list in a parameter named 'source-file-names'. In the template, define a global template parameter and then load the content of the files as follows:
<xsl:param name="source-file-names" /> <xsl:variable name="names-sequence" select="tokenize($source-file-names,'\|')" /> <xsl:variable name="cfg-files" select="document($names-sequence)" />
From the XSL engine point of view, it is then in fact a 1:1 transformation of a single file: a single source file is transformed into a single destination file.
The content of the single source file can then be enriched in the template by the multiple source files.
<project> ... <build> <plugins> <plugin> <groupId>net.sf.xsltmp</groupId> <artifactId>xslt-generator-maven-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>transform-abc</id> <goals> <goal>many-to-one</goal> </goals> <configuration> <xslTemplate>path/to/template.xsl</xslTemplate> <srcDir>src/main/xml</srcDir> <srcIncludes>**/*-abc.xml</srcIncludes> <srcFile>path/to/source.xml</srcFile> <destFile>path/to/destination.xml</destFile> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>