Changeset 5213
- Timestamp:
- 05/18/14 12:45:53 (10 years ago)
- Location:
- SMC/trunk/SMC/src/xsl
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SMC/trunk/SMC/src/xsl/smc_commons.xsl
r3526 r5213 32 32 <xsl:variable name="cmd_components_uri" select="my:config('cmd-components','url')" /> 33 33 <xsl:variable name="cmd_profiles_uri" select="my:config('cmd-profiles','url_prefix')" /> 34 35 <!-- intermediate datasets bound into variables,to prevent calling the function every time --> 36 <xsl:variable name="dcr-terms-preload" select="my:getData('dcr-terms-preload')" /> 37 <xsl:variable name="dcr-terms" select="my:getData('dcr-terms')" /> 38 <xsl:variable name="rr-relations" select="my:getData('rr-relations')" /> 39 <!-- rr-relations expanded with terms--> 40 <xsl:variable name="rr-terms" select="my:getData('rr-terms')" /> 41 <xsl:variable name="cmd-terms" select="my:getData('cmd-terms')" /> 42 <xsl:variable name="cmd-terms-nested" select="my:getData('cmd-terms-nested')" /> 43 <xsl:variable name="dcr-cmd-map" select="my:getData('dcr-cmd-map')" /> 44 <xsl:variable name="isocat-languages" select="my:getData('isocat-languages')" /> 45 46 <xsl:key name="concept-id" match="Concept" use="xs:string(@id)" /> 34 35 36 <xsl:key name="concept-id" match="Concept" use="xs:string(@id)" /> 47 37 48 38 <!-- --> … … 81 71 82 72 <xsl:result-document href="{$cache_path}" format="xml" > 83 <xsl: copy-ofselect="$result" />73 <xsl:sequence select="$result" /> 84 74 </xsl:result-document> 85 75 </xsl:if> 86 <xsl:if test="not(exists($result/*))">76 <xsl:if test="not(doc-available($cache_path)) and not(exists($result/*))"> 87 77 <xsl:call-template name="message"> 88 78 <xsl:with-param name="message">WARNING: no data for <xsl:value-of select="$cache_path" /></xsl:with-param> 89 79 </xsl:call-template> 90 80 <xsl:result-document href="{$cache_path}" format="xml" > 81 <diagnostics>no data for <xsl:value-of select="$id" /></diagnostics> 82 </xsl:result-document> 91 83 </xsl:if> 92 84 … … 163 155 </xsl:when> 164 156 <xsl:when test="$key='profiles' or $key='datcats'"> 165 <xsl: copy-ofselect="my:getRawData($key, $id)" />157 <xsl:sequence select="my:getRawData($key, $id)" /> 166 158 </xsl:when> 167 159 <xsl:when test="$key='cmd-resolved'"> … … 175 167 </xsl:when> 176 168 <xsl:when test="$key='cmd-terms-nested-minimal'"> 177 <xsl:apply-templates select="$cmd-terms-nested" mode="min-context"></xsl:apply-templates> 169 <xsl:variable name="cmd-terms-nested" select="my:getData('cmd-terms-nested')" /> 170 <xsl:apply-templates select="$cmd-terms-nested" mode="min-context"> 171 <xsl:with-param name="all-terms" tunnel="yes" select="$cmd-terms-nested" /> 172 </xsl:apply-templates> 178 173 </xsl:when> 179 174 <xsl:when test="$key='dcr-terms-preload'"> … … 232 227 <xd:p>Storing to cache happens in load-profiles template</xd:p> 233 228 </xd:desc> 234 <xd:param name="key"> currently only 'profiles'</xd:param>229 <xd:param name="key">'profiles', 'datcats'</xd:param> 235 230 <xd:param name="id">id for the profile</xd:param> 236 231 </xd:doc> … … 259 254 </xsl:call-template> 260 255 <xsl:if test="doc-available($resolved_uri)"> 261 <xsl: copy-ofselect="doc($resolved_uri)" />256 <xsl:sequence select="doc($resolved_uri)" /> 262 257 <!-- <xsl:apply-templates select="document($resolved_uri)" mode="include" />--> 263 258 </xsl:if> … … 290 285 </xd:doc> 291 286 <xsl:template name="postload-datcats"> 292 293 <xsl:variable name="missing-datcats" select="distinct-values( $cmd-terms//Term[not(@datcat='')][not(@datcat =$dcr-terms-preload//Concept/@id)]/@datcat)" />287 <xsl:variable name="dcr-terms-preload" select="my:getData('dcr-terms-preload')" /> 288 <xsl:variable name="missing-datcats" select="distinct-values(my:getData('cmd-terms')//Term[not(@datcat='')][not(@datcat =$dcr-terms-preload//Concept/@id)]/@datcat)" /> 294 289 <xsl:for-each select="$missing-datcats"> 295 290 <!-- <xsl:copy-of select="my:getRawData('datcats',.)" />--> … … 400 395 <xsl:template name="dcr-cmd-map"> 401 396 <xsl:variable name="dcr-terms" select="my:getData('dcr-terms')" /> 397 <xsl:variable name="cmd-terms" select="my:getData('cmd-terms')" /> 398 402 399 <Termset type="dcr-cmd-map" > 403 400 <xsl:for-each-group select="$cmd-terms//Term[not(@datcat='')]" group-by="@datcat"> … … 420 417 </xd:desc> 421 418 </xd:doc> 422 <xsl:template name="termsets"> 419 <xsl:template name="termsets"> 420 <xsl:variable name="isocat-languages" select="my:getData('isocat-languages')" /> 421 <xsl:variable name="cmd-terms" select="my:getData('cmd-terms')" /> 423 422 <Termsets type="list"> 424 423 <!-- add dcr-termsets directly from config --> … … 479 478 </xd:desc> 480 479 </xd:doc> 481 <xsl:template name="rr-terms"> 480 481 <xsl:template name="rr-terms"> 482 <xsl:variable name="rr-relations" select="my:getData('rr-relations')" /> 482 483 <xsl:apply-templates select="$rr-relations" mode="rr-expand" ></xsl:apply-templates> 483 484 </xsl:template> … … 495 496 </xd:desc> 496 497 </xd:doc> 497 <xsl:template match="Concept" mode="rr-expand"> 498 <xsl:variable name="concept-id" select="@id" /> 498 <xsl:template match="Concept" mode="rr-expand"> 499 <xsl:variable name="concept-id" select="@id" /> 500 <xsl:variable name="dcr-cmd-map" select="my:getData('dcr-cmd-map')" /> 499 501 <xsl:copy> 500 502 <xsl:copy-of select="@*" /> -
SMC/trunk/SMC/src/xsl/smc_functions.xsl
r3526 r5213 194 194 <!-- computing minimal unique path/index --> 195 195 <xsl:template match="Term" mode="min-context" > 196 <xsl:param name="all-terms" select="$cmd-terms-nested" /> 197 <xsl:param name="term" select="." /> 198 196 <xsl:param name="all-terms" /> 197 <xsl:param name="term" select="." /> 199 198 200 199 <!--<xsl:variable name="termset_id" select="if (exists(ancestor::Termset/@id)) then ancestor::Termset/@id else ancestor::Termset/@name" />-->
Note: See TracChangeset
for help on using the changeset viewer.