You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marcelo Romulo Fernandes <ma...@yahoo.com> on 2008/07/18 02:06:42 UTC

merging two xml files using xslt-maven-plugin

I want to merge two xml files using xslt. 
Both the faces-config xml files have a faces-config tag. If I put the complete faces-config tag, the merge fails. Why?

the single faces-config tag is
<faces-config>

the complete faces-config tag is
<faces-config version="1.2"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee">

I call xslt-maven-plugin this way at my pom.xml

            <!-- faces-config merge -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xslt-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>merge-faces-config</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                        <configuration>
                            <xslFile>${org.basegen.otherGen.dir}/xslt/mergeFacesConfig.xsl</xslFile>
                            <srcDir>${org.basegen.srcCustom.dir}/view/</srcDir>
                            <destDir>${org.basegen.webGenerated.dir}/WEB-INF/</destDir>
                            <srcIncludes>faces-config-custom.xml</srcIncludes>
                            <fileNameRegex>faces-config-custom</fileNameRegex>
                            <fileNameReplacement>faces-config</fileNameReplacement>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

the xslt file and the two xml files with single faces-config tab are attached.

thanks a lot in advance
�s marcelo