- Timestamp:
- 03/13/13 10:06:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/test/DEBBTranslator/xml/PLMXMLTranslator.xsl
r949 r950 18 18 19 19 <!-- Information from which level the translator should start moving information to templates --> 20 <xsl:variable name="templateStartLevel" select="' Node'" />20 <xsl:variable name="templateStartLevel" select="''" /> 21 21 22 22 <!-- Specification of the output document --> … … 44 44 </xsl:element> 45 45 46 <xsl:if test="fun:containsTemplates()"> 46 <!-- Create templates (if needed) --> 47 <xsl:if test="fun:containsTemplates() = true()"> 47 48 <xsl:element name="templates"> 48 49 <!-- Iterate the document and createTemplates --> … … 137 138 <xsl:variable name="debbComponentId" 138 139 select="plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value" /> 140 141 <xsl:variable name="debbComponentFile" 142 select="plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value" /> 139 143 140 144 <xsl:attribute name="class"> … … 144 148 <xsl:choose> 145 149 <xsl:when test="$debbLevel = $templateStartLevel"> 146 <!-- Change into template. The rest of the hierarchy will be in template. -->150 <!-- Change into template. The rest of the hierarchy will be in a corresponding template. --> 147 151 <xsl:element name="templateId"> 148 152 <xsl:value-of select="$debbLevel"/> … … 152 156 </xsl:when> 153 157 <xsl:otherwise> 158 159 <!-- Read information from DEBBComponent file --> 160 <xsl:choose> 161 <!-- DEBB Components file is defined --> 162 <xsl:when test="$debbComponentFile != ''"> 163 <xsl:comment> 164 DEBB Component file is <xsl:value-of select="$debbComponentFile" /> 165 </xsl:comment> 166 <xsl:variable name="nestedDoc" select="document($debbComponentFile)" /> 167 168 <!-- <xsl:value-of select="fun:translateDEBBComponent($nestedDoc, $debbComponentFile)"/>--> 169 170 <xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]"> 171 <xsl:with-param name="computingResourceClasses"> 172 <xsl:value-of select="$computingResourceClasses" /> 173 </xsl:with-param> 174 <xsl:with-param name="resourceUnitClasses"> 175 <xsl:value-of select="$resourceUnitClasses" /> 176 </xsl:with-param> 177 </xsl:apply-templates> 178 179 </xsl:when> 180 <!-- DEBB Components file is not defined. Use default one. --> 181 <xsl:otherwise> 182 <xsl:comment> 183 DEBB Component file is <xsl:value-of select="$defaultDEBBComponentsFileName" /> 184 </xsl:comment> 185 <xsl:variable name="nestedDoc" 186 select="document($defaultDEBBComponentsFileName)" /> 187 188 <!-- <xsl:value-of select="fun:translateDEBBComponent($nestedDoc, $debbComponentFile)"/>--> 189 190 <xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]"> 191 <xsl:with-param name="computingResourceClasses"> 192 <xsl:value-of select="$computingResourceClasses" /> 193 </xsl:with-param> 194 <xsl:with-param name="resourceUnitClasses"> 195 <xsl:value-of select="$resourceUnitClasses" /> 196 </xsl:with-param> 197 </xsl:apply-templates> 198 199 </xsl:otherwise> 200 </xsl:choose> 201 154 202 <!-- Iterate children and ask them to translate themselves --> 155 203 <xsl:for-each select="1 to count($tokenizedText)"> … … 184 232 </xsl:attribute> 185 233 186 <!-- Read information from DEBBComponent file --> 187 234 <!-- Read information from DEBBComponent file --> 188 235 <xsl:choose> 189 236 <!-- DEBB Components file is defined --> … … 355 402 356 403 <xsl:function name="fun:containsTemplates"> 357 <xsl:variable name="productRevisionViews" select="$rootDoc//plm:ProductRevisionView[UserData/UserValue/@DEBBLevel=$templateStartLevel]"/> 358 <xsl:value-of select="count($productRevisionViews) > 0"/> 404 <xsl:variable name="productRevisionViews" select="$rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@title='DEBBLevel' and plm:UserData/plm:UserValue/@value=$templateStartLevel]"/> 405 <xsl:variable name="numberOfTemplates" select="count($productRevisionViews)"/> 406 407 <xsl:value-of select="$numberOfTemplates > 0"/> 359 408 </xsl:function> 360 409
Note: See TracChangeset
for help on using the changeset viewer.