]> source.dussan.org Git - archiva.git/blob
9d0791e51c9234e19657cfe9759355d982c87bd8
[archiva.git] /
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3     version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:output method="xml" indent="yes"
6     doctype-public="-//SPRING//DTD BEAN 2.0//EN"
7     doctype-system="http://www.springframework.org/dtd/spring-beans-2.0.dtd" />
8
9 <xsl:template match="/component-set">
10 <beans>
11   <xsl:for-each select="components/component">
12     <bean>
13       <xsl:choose>
14         <xsl:when test="role-hint">
15           <xsl:attribute name="id">
16             <xsl:value-of select="concat( role, '#', role-hint )" />
17           </xsl:attribute>
18         </xsl:when>
19         <xsl:otherwise>
20           <xsl:attribute name="id">
21             <xsl:value-of select="role" />
22           </xsl:attribute>
23         </xsl:otherwise>
24       </xsl:choose>
25       <xsl:attribute name="class">
26         <xsl:value-of select="implementation" />
27       </xsl:attribute>
28         <xsl:if test="instanciation-strategy/text() = 'per-lookup'">
29           <xsl:attribute name="scope">prototype</xsl:attribute>
30         </xsl:if>
31       <xsl:for-each select="requirements/requirement">
32         <property>
33           <xsl:attribute name="name">
34             <xsl:value-of select="field-name" />
35           </xsl:attribute>
36           <xsl:choose>
37             <xsl:when test="role-hint">
38               <xsl:attribute name="ref">
39                 <xsl:value-of select="concat( role, '#', role-hint )" />
40               </xsl:attribute>
41             </xsl:when>
42             <xsl:otherwise>
43               <xsl:attribute name="ref">
44                 <xsl:value-of select="role" />
45               </xsl:attribute>
46             </xsl:otherwise>
47           </xsl:choose>
48         </property>
49       </xsl:for-each>
50       <xsl:for-each select="configuration/*">
51         <property>
52           <xsl:attribute name="name">
53             <xsl:value-of select="name(.)" />
54           </xsl:attribute>
55           <xsl:attribute name="value">
56             <xsl:value-of select="." />
57           </xsl:attribute>
58         </property>
59       </xsl:for-each>
60     </bean>
61   </xsl:for-each>
62 </beans>
63 </xsl:template>
64
65 </xsl:stylesheet>