Ignore:
Timestamp:
03/07/13 10:20:04 (12 years ago)
Author:
gosiaw
Message:

Added parameter fullPath for computingResource elements, containing full path to the element (/ComputeBox2/ComputeBox1/NodeGroup/Node).

File:
1 edited

Legend:

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

    r918 r919  
    215215                        <xsl:apply-templates select="parameter" /> 
    216216                         
     217                        <xsl:variable name="debbFullPath" select="fun:getFullPath(.)"/> 
     218                        <xsl:if test="$debbFullPath != ''"> 
     219                                <xsl:element name="parameter"> 
     220                                        <xsl:attribute name="name">fullPath</xsl:attribute> 
     221                                        <xsl:element name="value"> 
     222                                                <xsl:value-of select="$debbFullPath" /> 
     223                                        </xsl:element> 
     224                                </xsl:element> 
     225                        </xsl:if>                                
     226                         
     227                         
    217228                        <xsl:variable name="resourceClass" select="@class"/> 
    218229                        <xsl:variable name="resourceType" select="@type"/> 
     
    270281        </xsl:template> 
    271282         
     283        <xsl:function name="fun:getFullPath"> 
     284                <xsl:param name="currentComputingResource"/> 
     285                <xsl:variable name="ancestors" select="$currentComputingResource/ancestor::computingResource/@name"/> 
     286                 
     287                <xsl:variable name="fullPath"> 
     288                        <xsl:text>/</xsl:text> 
     289                        <xsl:for-each select="1 to count($ancestors)"> 
     290                                <xsl:variable name="index" select="." /> 
     291                                <xsl:value-of select="$ancestors[$index]"/> 
     292                                <xsl:text>/</xsl:text> 
     293                        </xsl:for-each>  
     294                        <xsl:value-of select="$currentComputingResource/@name"></xsl:value-of>   
     295                </xsl:variable> 
     296                 
     297                <xsl:value-of select="$fullPath"/> 
     298        </xsl:function> 
     299         
    272300        <xsl:template match="resourceUnit | parameter | location"> 
    273301                <xsl:copy-of select="." copy-namespaces="no" /> 
Note: See TracChangeset for help on using the changeset viewer.