The primary goal of this tool is to reduce the size of XSL files used in client side XSLT in web browsers.
xslmin performs the following minification tasks:
xsl:preserve-space
<element name="foo">
becomes <foo>
Inlines xsl:attributes e.g.
<element name="foo">
<attribute name="bar">
<value-of select="$foobar"></value-of>
</attribute>
</element>
becomes
<foo bar="{$foobar}">
You can download the latest JAR from Maven Central
java -jar xslmin.jar inputXslPath outputXslPath [-p[reserve]]
The easiest way is to use maven and the maven-antrun-plugin
to fetch xslmin and then use it in your ant build like so:
<path id="project.class.path">
<path path="${maven.plugin.classpath}"/>
</path>
<taskdef name="xslmin"
classname="com.github.ricksbrown.xslmin.ant.MinifyTask"
classpathref="https://github.com/ricksbrown/xslmin/blob/master/project.class.path"/>
<xslmin in="${srcdir}/myxsl.xsl" out="${outdir}/myxsl.xsl" preserve="true"/>
2.3.0
com.github.ricksbrown.xslmin
.Now available on Maven Central
<dependency>
<groupId>com.github.ricksbrown</groupId>
<artifactId>xslmin</artifactId>
<version>2.3.0</version>
</dependency>