Ignore:
Timestamp:
11/12/12 14:03:26 (12 years ago)
Author:
gosiaw
Message:

Some validation problems eliminated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/test/DEBBTranslator/xml/DEBBComponentTranslator.xsl

    r596 r597  
    2323                                <xsl:value-of select="ComponentId" /> 
    2424                        </xsl:attribute> 
     25                        <xsl:if test="Memory"> 
     26                                <xsl:apply-templates select="Memory" /> 
     27                        </xsl:if> 
     28                        <xsl:if test="Storage"> 
     29                                <xsl:apply-templates select="Storage" /> 
     30                        </xsl:if> 
     31                        <xsl:if test="CoolingDevice"> 
     32                                <xsl:apply-templates select="CoolingDevice" /> 
     33                        </xsl:if> 
    2534                        <xsl:call-template name="BasicDEBBPhysicalElementData" /> 
    2635                        <xsl:if test="Baseboard"> 
     
    3039                                <xsl:apply-templates select="Processor" /> 
    3140                        </xsl:if> 
    32                         <xsl:if test="Memory"> 
    33                                 <xsl:apply-templates select="Memory" /> 
    34                         </xsl:if> 
    35                         <xsl:if test="Storage"> 
    36                                 <xsl:apply-templates select="Storage" /> 
    37                         </xsl:if> 
    38                         <xsl:if test="CoolingDevice"> 
    39                                 <xsl:apply-templates select="CoolingDevice" /> 
    40                         </xsl:if> 
    4141                </xsl:element> 
    4242        </xsl:template> 
     
    4444        <xsl:template match="Baseboard"> 
    4545                <xsl:element name="parameter"> 
    46                         <xsl:attribute name="class">Baseboard</xsl:attribute> 
     46                        <xsl:attribute name="name">Baseboard</xsl:attribute> 
    4747                        <!-- Don't call BasicDEBBPhysicalElementData, because parameter cannot  
    4848                                contain parameters. Must be parameter containing properties. --> 
     
    134134                                </xsl:element> 
    135135                        </xsl:element> 
    136  
    137136                </xsl:element> 
    138137        </xsl:template> 
     
    141140                <xsl:element name="resourceUnit"> 
    142141                        <xsl:attribute name="class">Memory</xsl:attribute> 
    143                         <xsl:call-template name="BasicDEBBPhysicalElementData" /> 
    144142                        <xsl:element name="amount"> 
    145143                                <xsl:value-of select="Capacity" /> 
    146144                        </xsl:element> 
     145                        <xsl:call-template name="BasicDEBBPhysicalElementData" /> 
    147146                </xsl:element> 
    148147        </xsl:template> 
     
    162161        <xsl:template match="CoolingDevice"> 
    163162                <!-- TODO: Not finished --> 
    164                 <xsl:element name="airThroughputProfile"> 
    165                         <!-- <xsl:attribute name="name">CoolingDevice</xsl:attribute> --> 
    166                         <!-- Obligatory attribute --> 
    167                         <xsl:element name="parameter"> 
    168                                 <xsl:attribute name="name">Class</xsl:attribute> 
    169                                 <xsl:element name="value"> 
    170                                         <xsl:value-of select="Class" /> 
    171                                 </xsl:element> 
    172                         </xsl:element> 
    173                         <xsl:if test="MaxCoolingCapacity"> 
     163                <xsl:element name="profile"> 
     164                        <xsl:element name="airThroughputProfile"> 
     165                                <!-- <xsl:attribute name="name">CoolingDevice</xsl:attribute> --> 
     166                                <!-- TODO: What to take it from?? --> 
     167<!--                            <xsl:element name="airThroughputEstimationPlugin">--> 
     168<!--                            </xsl:element>                          --> 
     169                                <xsl:if test="ThroughputProfile"> 
     170                                        <xsl:element name="airThroughputStates"> 
     171                                                <xsl:apply-templates select="ThroughputProfile" /> 
     172                                        </xsl:element> 
     173                                </xsl:if> 
     174                                <!-- Obligatory attribute --> 
    174175                                <xsl:element name="parameter"> 
    175                                         <xsl:attribute name="name">MaxCoolingCapacity</xsl:attribute> 
    176                                         <xsl:element name="value"> 
    177                                                 <xsl:value-of select="MaxCoolingCapacity" /> 
    178                                         </xsl:element> 
    179                                 </xsl:element> 
    180                         </xsl:if> 
    181                         <xsl:if test="MaxAirThroughput"> 
    182                                 <xsl:element name="parameter"> 
    183                                         <xsl:attribute name="name">MaxAirThroughput</xsl:attribute> 
    184                                         <xsl:element name="value"> 
    185                                                 <xsl:value-of select="MaxAirThroughput" /> 
    186                                         </xsl:element> 
    187                                 </xsl:element> 
    188                         </xsl:if> 
    189                         <xsl:if test="MaxWaterThroughput"> 
    190                                 <xsl:element name="parameter"> 
    191                                         <xsl:attribute name="name">MaxWaterThroughput</xsl:attribute> 
    192                                         <xsl:element name="value"> 
    193                                                 <xsl:value-of select="MaxWaterThroughput" /> 
    194                                         </xsl:element> 
    195                                 </xsl:element> 
    196                         </xsl:if> 
    197                         <xsl:if test="ThroughputProfile"> 
    198                                 <xsl:element name="airThroughputStates"> 
    199                                         <xsl:apply-templates select="ThroughputProfile" /> 
    200                                 </xsl:element> 
    201                         </xsl:if> 
    202                         <!-- TODO: What to take it from?? --> 
    203                         <xsl:element name="airThroughputEstimationPlugin"> 
    204                         </xsl:element> 
    205                         <xsl:call-template name="BasicDEBBPhysicalElementData" /> 
     176                                        <xsl:attribute name="name">Class</xsl:attribute> 
     177                                        <xsl:element name="value"> 
     178                                                <xsl:value-of select="Class" /> 
     179                                        </xsl:element> 
     180                                </xsl:element> 
     181                                <xsl:if test="MaxCoolingCapacity"> 
     182                                        <xsl:element name="parameter"> 
     183                                                <xsl:attribute name="name">MaxCoolingCapacity</xsl:attribute> 
     184                                                <xsl:element name="value"> 
     185                                                        <xsl:value-of select="MaxCoolingCapacity" /> 
     186                                                </xsl:element> 
     187                                        </xsl:element> 
     188                                </xsl:if> 
     189                                <xsl:if test="MaxAirThroughput"> 
     190                                        <xsl:element name="parameter"> 
     191                                                <xsl:attribute name="name">MaxAirThroughput</xsl:attribute> 
     192                                                <xsl:element name="value"> 
     193                                                        <xsl:value-of select="MaxAirThroughput" /> 
     194                                                </xsl:element> 
     195                                        </xsl:element> 
     196                                </xsl:if> 
     197                                <xsl:if test="MaxWaterThroughput"> 
     198                                        <xsl:element name="parameter"> 
     199                                                <xsl:attribute name="name">MaxWaterThroughput</xsl:attribute> 
     200                                                <xsl:element name="value"> 
     201                                                        <xsl:value-of select="MaxWaterThroughput" /> 
     202                                                </xsl:element> 
     203                                        </xsl:element> 
     204                                </xsl:if>                                
     205                                <xsl:call-template name="BasicDEBBPhysicalElementData" /> 
     206                        </xsl:element> 
    206207                </xsl:element> 
    207208        </xsl:template> 
     
    222223                        </xsl:if> 
    223224                        <xsl:if test="PowerUsage"> 
    224                                 <xsl:element name="value"> 
     225                                <xsl:element name="powerUsage"> 
    225226                                        <xsl:value-of select="PowerUsage" /> 
    226227                                </xsl:element> 
Note: See TracChangeset for help on using the changeset viewer.