1 <?xml version="1.0" encoding="UTF-8"?>
\r
3 ~ Licensed to the Apache Software Foundation (ASF) under one
\r
4 ~ or more contributor license agreements. See the NOTICE file
\r
5 ~ distributed with this work for additional information
\r
6 ~ regarding copyright ownership. The ASF licenses this file
\r
7 ~ to you under the Apache License, Version 2.0 (the
\r
8 ~ "License"); you may not use this file except in compliance
\r
9 ~ with the License. You may obtain a copy of the License at
\r
11 ~ http://www.apache.org/licenses/LICENSE-2.0
\r
13 ~ Unless required by applicable law or agreed to in writing,
\r
14 ~ software distributed under the License is distributed on an
\r
15 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
\r
16 ~ KIND, either express or implied. See the License for the
\r
17 ~ specific language governing permissions and limitations
\r
18 ~ under the License.
\r
22 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
23 xmlns:plexus="http://plexus.codehaus.org/spring">
\r
25 <xsl:output method="xml"/>
\r
28 Convert a plexus descriptor to a spring XML context with help of the custom <plexus: namespace
\r
29 to handle IoC containers incompatibilities.
\r
32 <xsl:template match="/component-set">
\r
33 <beans xmlns="http://www.springframework.org/schema/beans"
\r
34 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
\r
35 xmlns:plexus="http://plexus.codehaus.org/spring"
\r
36 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
\r
37 http://plexus.codehaus.org/spring http://plexus.codehaus.org/schemas/spring-1.0.xsd">
\r
38 <xsl:for-each select="components/component">
\r
41 <xsl:attribute name="role">
\r
42 <xsl:value-of select="role" />
\r
44 <xsl:if test="role-hint">
\r
45 <xsl:attribute name="role-hint">
\r
46 <xsl:value-of select="role-hint" />
\r
49 <xsl:attribute name="implementation">
\r
50 <xsl:value-of select="implementation" />
\r
52 <xsl:if test="instantiation-strategy">
\r
53 <xsl:attribute name="instantiation-strategy">
\r
54 <xsl:value-of select="instantiation-strategy" />
\r
57 <xsl:for-each select="requirements/requirement">
\r
58 <plexus:requirement>
\r
59 <xsl:attribute name="name">
\r
60 <xsl:value-of select="field-name" />
\r
62 <xsl:attribute name="role">
\r
63 <xsl:value-of select="role" />
\r
65 <xsl:if test="role-hint">
\r
66 <xsl:attribute name="role-hint">
\r
67 <xsl:value-of select="role-hint" />
\r
70 </plexus:requirement>
\r
72 <xsl:for-each select="configuration/*">
\r
73 <plexus:configuration>
\r
74 <xsl:attribute name="name">
\r
75 <xsl:value-of select="name(.)" />
\r
77 <xsl:attribute name="value">
\r
78 <xsl:value-of select="." />
\r
80 </plexus:configuration>
\r