ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jo Support <jo.supp...@gmail.com>
Subject ant, xsl and variables
Date Fri, 17 Dec 2010 12:53:45 GMT
Hello people,

how do I pass a variable to a stylesheet using xslt task?

I have this ant script:

                <property name="floorType" value="wood"/>

		<xslt basedir="${workDir}" extension=".xml" destdir="out/"
style="style/setValues.xsl">
			<include name="**/*.xml"/>
		</xslt>

and this stylesheet:

	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>
	</xsl:template>

	<xsl:template match="floor[../tapestry='red']">
		<floor>${floorType}</floor>
	</xsl:template>

but the process writes in the output file exactly

		<floor>${floorType}</floor>

instead of the value of the property.

Where am I doing wrong?

Thanks a lot

Jo

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message