Changeset 891 for DCWoRMS/trunk


Ignore:
Timestamp:
02/27/13 13:36:38 (12 years ago)
Author:
gosiaw
Message:

Handling resource names for energy estimation plugins added.

File:
1 edited

Legend:

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

    r890 r891  
    9191                        </xsl:variable> 
    9292                        <!-- <xsl:value-of select="$resourceType"/> --> 
    93                          
     93 
    9494                        <!-- Not clear why it does not work this way :/ --> 
    9595                        <!-- <xsl:variable name="resourceNames"><xsl:value-of select="resources/name"/></xsl:variable> --> 
     
    186186                        <xsl:variable name="resourceClass" select="../../@class"></xsl:variable> 
    187187                        <xsl:variable name="resourceType" select="../../@type"></xsl:variable> 
    188                         <xsl:variable name="resourceName" select="../../@name"></xsl:variable> 
     188                        <xsl:variable name="resourceNames" select="../../@name"></xsl:variable> 
    189189 
    190190                        <xsl:choose> 
    191                                 <xsl:when test="$resourceType != ''"> 
    192                                         <!-- resource class and type --> 
    193                                         <!-- Add information about energy estimation plugin --> 
    194                                         <xsl:apply-templates 
    195                                                 select="$nestedDoc//energyEstimationPlugin[resources/class = $resourceClass and resources/type = $resourceType]" /> 
     191                                <!-- Resource names are present --> 
     192                                <xsl:when test="count($resourceNames) > 0"> 
     193                                        <xsl:for-each select="$resourceNames"> 
     194                                                <xsl:variable name="index" select="position()" /> 
     195                                                <xsl:variable name="resourceName" select="." /> 
     196                                                <xsl:choose> 
     197                                                        <!-- Resource type is present --> 
     198                                                        <xsl:when test="$resourceType != ''"> 
     199                                                                <xsl:apply-templates 
     200                                                                        select="$nestedDoc//energyEstimationPlugin[resources/class=$resourceClass and resources/type=$resourceType and resources/name=$resourceName]" /> 
     201                                                        </xsl:when> 
     202                                                        <xsl:otherwise> 
     203                                                                <xsl:apply-templates 
     204                                                                        select="$nestedDoc//energyEstimationPlugin[resources/class=$resourceClass and resources/name=$resourceName]" /> 
     205                                                        </xsl:otherwise> 
     206                                                </xsl:choose> 
     207                                        </xsl:for-each> 
    196208                                </xsl:when> 
     209                                <!-- No resource names --> 
    197210                                <xsl:otherwise> 
    198                                         <!-- resource class only --> 
    199                                         <!-- Add information about energy estimation plugin --> 
    200                                         <xsl:apply-templates 
    201                                                 select="$nestedDoc//energyEstimationPlugin[resources/class = $resourceClass]" /> 
     211                                        <xsl:choose> 
     212                                                <!-- Resource type is present --> 
     213                                                <xsl:when test="$resourceType != ''"> 
     214                                                        <xsl:apply-templates 
     215                                                                select="$nestedDoc//energyEstimationPlugin[resources/class=$resourceClass and resources/type=$resourceType]" /> 
     216                                                </xsl:when> 
     217                                                <xsl:otherwise> 
     218                                                        <xsl:apply-templates 
     219                                                                select="$nestedDoc//energyEstimationPlugin[resources/class=$resourceClass]" /> 
     220                                                </xsl:otherwise> 
     221                                        </xsl:choose> 
    202222                                </xsl:otherwise> 
    203                         </xsl:choose> 
    204                         <!-- Copy all children of powerProfile --> 
     223                        </xsl:choose><!-- <xsl:choose> <xsl:when test="$resourceType != ''"> resource  
     224                                class and type Add information about energy estimation plugin <xsl:apply-templates  
     225                                select="$nestedDoc//energyEstimationPlugin[resources/class = $resourceClass  
     226                                and resources/type = $resourceType]" /> </xsl:when> <xsl:otherwise> resource  
     227                                class only Add information about energy estimation plugin <xsl:apply-templates  
     228                                select="$nestedDoc//energyEstimationPlugin[resources/class = $resourceClass]"  
     229                                /> </xsl:otherwise> </xsl:choose> --><!-- Copy all children of powerProfile --> 
    205230                        <xsl:copy-of select="@*|node()" /> 
    206231                </xsl:copy> 
Note: See TracChangeset for help on using the changeset viewer.