Improve the blueprint imported package discovery (use the same xslt transformation as in bundleplugin)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@811005 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/deployer/blueprint/src/main/resources/org/apache/felix/karaf/deployer/blueprint/extract.xsl b/karaf/deployer/blueprint/src/main/resources/org/apache/felix/karaf/deployer/blueprint/extract.xsl
index 2c8c291..eb44e25 100644
--- a/karaf/deployer/blueprint/src/main/resources/org/apache/felix/karaf/deployer/blueprint/extract.xsl
+++ b/karaf/deployer/blueprint/src/main/resources/org/apache/felix/karaf/deployer/blueprint/extract.xsl
@@ -17,30 +17,41 @@
     limitations under the License.
 
 -->
-<xsl:stylesheet version="1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
-    <xsl:output method="text" />
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+	<xsl:output method="text" />
 
 	<xsl:template match="/">
 
-		<!-- Match all attributes that holds a class or a comma delimited
+		<!-- Match all attributes that holds a class or a comma delimited 
 		     list of classes and print them -->
 
 		<xsl:for-each select="
-				//bp:*/@class
-			|	//bp:*/@type
-			|	//bp:*/@value-type
-			|	//bp:*/@key-type
-			|	//bp:*/bp:interfaces/bp:value/text()
+				//bp:bean/@class 
+			|	//bp:service/@interface 
+			|   //bp:service/bp:interfaces/bp:value/text()
+ 			|	//bp:reference/@interface
+			|	//bp:reference-list/@interface
 		">
 			<xsl:value-of select="." />
 			<xsl:text>
 			</xsl:text>
 		</xsl:for-each>
 
-		<!-- This seems some magic to get extra imports? -->
+		<xsl:for-each select="
+				//bp:bean/bp:argument/@type
+		    |	//bp:list/@value-type 
+    		|	//bp:set/@value-type 
+    		|	//bp:array/@value-type 
+			|   //bp:map/@key-type
+			|   //bp:map/@value-type
+		">
+		    <xsl:choose>
+		        <xsl:when test="contains(., '[')"><xsl:value-of select="substring-before(., '[')"/></xsl:when>
+		        <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>
+			</xsl:text>
+		</xsl:for-each>
 
 	</xsl:template>