StrutsConfigXMLPlugin merge is broken for struts-plugins.xml when merging 
multiple plug-in elements
---------------------------------------------------------------------------------------------------

         Key: XDP-83
         URL: http://jira.codehaus.org/browse/XDP-83
     Project: XDoclet 2 Plugins
        Type: Bug
    Versions: ejb-1.0    
 Environment: xdoclet 2.0.3/plugins 1.0.1
 Reporter: Renaud Bruyeron



It is not possible to merge multiple plugins via the merge feature. This is 
because StrutsConfigXMLPlugin.jelly does this:
                <!-- plugins merge contents... -->
                <j:if 
test="${plugin.getMergeFile('struts-plugins.xml').exists()}">
                        <x:parse var="plugins" 
xml="${plugin.getMergeFile('struts-plugins.xml')}"/>
                </j:if>
                <jsl:stylesheet select="$plugins">
                        <jsl:template match="*" trim="false">
                                <jsl:copy>
                                        <jsl:applyTemplates/>
                                </jsl:copyf>
                        </jsl:template>
                </jsl:stylesheet>
This restricts the merged file to a single <plug-in> element.
I modified it to make it work like so:
                <!-- plugins merge contents... -->
                <j:if 
test="${plugin.getMergeFile('struts-plugins.xml').exists()}">
                        <x:parse var="plugins" 
xml="${plugin.getMergeFile('struts-plugins.xml')}"/>
                </j:if>
                <jsl:stylesheet select="$plugins">
                        <jsl:template match="*" trim="false">
                                <x:copyOf select="plug-in">
                                        <jsl:applyTemplates/>
                                </x:copyOf>
                        </jsl:template>
                </jsl:stylesheet>

My merged file looks like this:
<struts-config>
        <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property
                property="pathnames"
                        
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
        </plug-in>
        <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation" 
value="/WEB-INF/application-context.xml,/WEB-INF/action-servlet.xml, 
/WEB-INF/email-templates.xml"/>
        </plug-in>
</struts-config>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xdoclet-plugins-interest mailing list
xdoclet-plugins-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to