Changeset 3438 for SMC


Ignore:
Timestamp:
08/20/13 11:34:34 (11 years ago)
Author:
vronk
Message:

added minimal doc and my:cachePath function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SMC/trunk/SMC/src/xsl/smc_functions.xsl

    r2482 r3438  
    1414        <xsl:key name="term-name" match="//Term" use="@name"></xsl:key>
    1515-->
     16
     17        <xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">
     18                <xd:desc>
     19                        <xd:p><xd:b>Created on:</xd:b> May 15, 2013</xd:p>
     20                        <xd:p><xd:b>Author:</xd:b> m</xd:p>
     21                        <xd:p>This is used when resolving the cache-path. This way it is always interpreted relative to the primary source document.
     22                                Otherwise the cache-path was interpreted inconsistently in the doc()-function vs. xsl:result-document@href </xd:p>
     23                </xd:desc>
     24        </xd:doc>
     25        <xsl:variable name="base-uri" select="base-uri()" />
     26       
    1627 <!--
    1728 @param profiles - list of <profileDescription>
     
    2435                <xsl:for-each select="$profiles" >
    2536                        <xsl:variable name="profile_id" select="id"></xsl:variable>
    26                         <Termset name="{name}"  id="{$profile_id}" type="CMD_Profile">
     37                        <Termset name="{(name,CMD_ComponentSpec/Header/Name)[1]}"  id="{$profile_id}" type="CMD_Profile">
    2738                               
    2839                                        <!-- flattening the structure! -->
     
    287298        </xsl:function>
    288299       
     300       
     301        <!-- resolve cache path relative to the primary input-document -->
     302        <xsl:function name="my:cachePath">
     303                <xsl:param name="key" />               
     304                <xsl:param name="id" />
     305               
     306                <xsl:value-of select="concat(resolve-uri($cache_dir,$base-uri), if (ends-with($cache_dir,'/') or ends-with($cache_dir,'\')) then '' else '/',
     307                $key, if ($id!='') then concat('/', my:normalize($id)) else '', '.xml')" />             
     308        </xsl:function>
     309       
     310       
     311       
    289312</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.