> You could use global XSLT parameters in your stylesheet and configure the
> XSLT plugin to populate these parameters from its configuration [0] in the
> POM where you can use the Maven property from your current profile.
>

Thanks a lot that pushed me in the correct direction :-)

However I had to upgrade to the 1.1-SNAPSHOT xslt-maven-plugin to get the
parameters work
(code can be found here:
https://svn.codehaus.org/mojo/trunk/mojo/xslt-maven-plugin/ )

Implemented like this:

pom.xml:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xslt-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <srcDir>src/main/xsl/original-mappings/</srcDir>
                    <destDir>src/main/resources</destDir>
                    <xslFile>src/main/xsl/transform.xsl</xslFile>
                    <srcIncludes>**/*.hbm.xml</srcIncludes>
                    *<parameters>
                        <schema>${jdbc.username}</schema>
                    </parameters>*
                </configuration>

Transformation stylesheet:

<xsl:param name="schema"></xsl:param>

<xsl:template match="class/@catalog">
        <xsl:attribute name="catalog"><xsl:value-of
select="$schema"></xsl:value-of></xsl:attribute>
</xsl:template>


Thanks again,

Olivier










>
> Alternatively, you could use the Maven AntRun Plugin [1] to
> filter/interpolate your stylesheets before processing by the XSLT Plugin.
>
>
> Benjamin
>
>
> [0]
> http://mojo.codehaus.org/xslt-maven-plugin/transform-mojo.html#parameters
> [1] http://maven.apache.org/plugins/maven-antrun-plugin/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>


-- 
"Talent and all that for the most part is nothing but hogwash. Any schoolboy
with a little aptitude might very well draw better than I perhaps; but what
he most often lacks is the tough yearning for realization, the
teeth-grinding obstinacy and saying: even though I know I'm not capable of
it, I'm still going to do it." -- M.C. Escher, in a letter to his son
Arthur, 12 February 1955

Reply via email to