Index: DCWoRMS/trunk/src/test/DEBBTranslator/xml/PLMXMLTranslator.xsl
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/xml/PLMXMLTranslator.xsl	(revision 692)
+++ DCWoRMS/trunk/src/test/DEBBTranslator/xml/PLMXMLTranslator.xsl	(revision 800)
@@ -7,11 +7,13 @@
 	<xsl:import href="DEBBComponentTranslator.xsl" />
 
-	<!-- Information for mapping of DEBB classes into DCWoRMS computingResource classes -->
-	<xsl:param name="computingResourceClasses" select="computingResourceClasses"/>
-	
-	<!-- Information for mapping of resource classes into DCWoRMS resourceUnits classes -->
+	<!-- Information for mapping of DEBB classes into DCWoRMS computingResource 
+		classes -->
+	<xsl:param name="computingResourceClasses" select="computingResourceClasses" />
+
+	<!-- Information for mapping of resource classes into DCWoRMS resourceUnits 
+		classes -->
 	<!-- (Needed to pass to DEBB Components xslt) -->
-	<xsl:param name="resourceUnitClasses" select="resourceUnitClasses"/>
-	
+	<xsl:param name="resourceUnitClasses" select="resourceUnitClasses" />
+
 	<!-- Specification of the output document -->
 	<xsl:output method="xml" version="1.0" encoding="UTF-8"
@@ -26,10 +28,10 @@
 
 
-	<xsl:template match="/">	
+	<xsl:template match="/">
 		<xsl:element name="environment">
 			<xsl:attribute name="xsi:noNamespaceSchemaLocation">DCWormsResSchema.xsd</xsl:attribute>
 			<xsl:element name="resources">
 				<xsl:apply-templates select="//plm:InstanceGraph" />
-				<xsl:element name="scheduler"></xsl:element>				
+				<xsl:element name="scheduler"></xsl:element>
 			</xsl:element>
 		</xsl:element>
@@ -51,8 +53,9 @@
 			<xsl:element name="computingResource">
 				<xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
-				
+
 				<!-- Find corresponding ProductRevisionView and let it translate itself -->
-				<xsl:apply-templates select="//plm:ProductRevisionView[@id=$productInstanceId]" />			
-					
+				<xsl:apply-templates
+					select="//plm:ProductRevisionView[@id=$productInstanceId]" />
+
 				<!-- Add hostnames, labels, locations, sequences, etc. -->
 				<xsl:variable name="debbHostname"
@@ -85,5 +88,5 @@
 						</xsl:element>
 					</xsl:element>
-				</xsl:if>				
+				</xsl:if>
 				<xsl:variable name="debbSequence"
 					select="plm:UserData/plm:UserValue[@title='sequence']/@value" />
@@ -103,5 +106,5 @@
 		<!-- instanceRefs contain space separated ids of nested DEBBs -->
 		<xsl:variable name="tokenizedText" select="tokenize(@instanceRefs, ' ')" />
-		
+
 		<!-- DEBBLevel -->
 		<xsl:variable name="debbLevel"
@@ -110,5 +113,5 @@
 		<xsl:variable name="debbComponentId"
 			select="plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value" />
-		<!-- DEBBComponentFile -->	
+		<!-- DEBBComponentFile -->
 		<xsl:variable name="debbComponentFile"
 			select="plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value" />
@@ -118,7 +121,9 @@
 		</xsl:attribute>
 
-		<xsl:attribute name="type">
-			<xsl:value-of select="$debbComponentId" />
-		</xsl:attribute>
+		<xsl:if test="$debbComponentId != ''">
+			<xsl:attribute name="type">
+				<xsl:value-of select="$debbComponentId" />
+			</xsl:attribute>
+		</xsl:if>
 
 		<!-- Add DEBB information from DEBB Components file -->
@@ -126,5 +131,8 @@
 			<!-- DEBB Components file is defined -->
 			<xsl:when test="$debbComponentFile != ''">
-				<xsl:comment>DEBB Component file is <xsl:value-of select="$debbComponentFile"/></xsl:comment>
+				<xsl:comment>
+					DEBB Component file is
+					<xsl:value-of select="$debbComponentFile" />
+				</xsl:comment>
 				<xsl:variable name="nestedDoc" select="document($debbComponentFile)" />
 				<xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]" />
@@ -132,13 +140,16 @@
 			<!-- DEBB Components file is not defined. Use default one. -->
 			<xsl:otherwise>
-				<xsl:comment>DEBB Component file is <xsl:value-of select="$defaultDEBBComponentsFileName"/></xsl:comment>
+				<xsl:comment>
+					DEBB Component file is
+					<xsl:value-of select="$defaultDEBBComponentsFileName" />
+				</xsl:comment>
 				<xsl:variable name="nestedDoc"
 					select="document($defaultDEBBComponentsFileName)" />
-				<xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]" >
+				<xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]">
 					<xsl:with-param name="computingResourceClasses">
-						<xsl:value-of select="$computingResourceClasses"/>
-					</xsl:with-param>			
+						<xsl:value-of select="$computingResourceClasses" />
+					</xsl:with-param>
 					<xsl:with-param name="resourceUnitClasses">
-						<xsl:value-of select="$resourceUnitClasses"/>
+						<xsl:value-of select="$resourceUnitClasses" />
 					</xsl:with-param>
 				</xsl:apply-templates>
