<xsl:stylesheet xmlns:src="http://www.sdml.info/srcML/src" xmlns:cpp="http://www.sdml.info/srcML/cpp" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xd="http://www.pnp-software.com/XSLTdoc" xmlns:util="http://www.pnp-software.com/util" xmlns:ax="http://control.ee.ethz.ch/XWeaver/AspectX" xmlns:xslt="http://xslt" version="1.0">
  
  
     <xd:doc type="stylesheet">
    
<xd:short>XSL Variable Declarations for join point of type <code>src:class</code></xd:short>
    
<xd:detail><xd:dollarVariables /></xd:detail>
    
<xd:cvsId>$Id: common.xsl 2 2005-01-19 16:09:12Z ibirrer $</xd:cvsId>
    
<xd:author>ibirrer</xd:author>
    
<xd:copyright>2004, P&amp;P Software GmbH</xd:copyright>
  
</xd:doc>

  
  
<xsl:param name="declarationSuffix" select="'undefined'" />
  
<xsl:param name="definitionSuffix" select="'undefined'" />
  
<xsl:param name="inlineSuffix" select="'undefined'" />
  
  
<xsl:namespace-alias stylesheet-prefix="xslt" result-prefix="xsl" />
  
  
<xsl:template match="*" mode="commonVariableDeclarations">
    
<!-- Set variables from parameters -->
    
<xslt:variable name="declarationSuffix" select="'{$declarationSuffix}'" />
    
<xslt:variable name="definitionSuffix" select="'{$definitionSuffix}'" />
    
<xslt:variable name="inlineSuffix" select="'{$inlineSuffix}'" />
    
    
<!-- Set filename -->
    
<xslt:variable name="filename" select="util:getFile(substring-before(base-uri(/), '.xml'))" />
    
    
<!-- Boolean variables -->
    
<xslt:variable name="isDeclaration" select="ends-with($filename,$declarationSuffix)" />
    
<xslt:variable name="isDefinition" select="ends-with($filename,$definitionSuffix)" />
    
<xslt:variable name="isInline" select="ends-with($filename,$inlineSuffix)" />        
    
    
<!-- definition -->
    
<xslt:variable name="definition">
      
<xslt:choose>
        
<xslt:when test="$isDefinition">
          
<xslt:value-of select="'this'" />
        
</xslt:when>
        
<xslt:when test="$isDeclaration">
          
<xslt:value-of select="concat(substring-before($filename,$declarationSuffix), $definitionSuffix, '.xml')" />
        
</xslt:when>
        
<xslt:when test="$isInline">
          
<xslt:value-of select="concat(substring-before($filename,$definitionSuffix), $definitionSuffix, '.xml')" />
        
</xslt:when>
      
</xslt:choose>
    
</xslt:variable>
    
    
<!-- declaration --> 
    
<xslt:variable name="declaration">
      
<xslt:choose>
        
<xslt:when test="$isDeclaration">
          
<xslt:value-of select="'this'" />
        
</xslt:when>
        
<xslt:when test="$isDefinition">
          
<xslt:value-of select="concat(substring-before($filename,$definitionSuffix), $declarationSuffix, '.xml')" />
        
</xslt:when>
        
<xslt:when test="$isInline">
          
<xslt:value-of select="concat(substring-before($filename,$inlineSuffix), $declarationSuffix, '.xml')" />
        
</xslt:when>
      
</xslt:choose>
    
</xslt:variable>
    
    
<!-- inline -->
    
<xslt:variable name="inline">
      
<xslt:choose>
        
<xslt:when test="$isInline">
          
<xslt:value-of select="'this'" />
        
</xslt:when>
        
<xslt:when test="$isDefinition">
          
<xslt:value-of select="concat(substring-before($filename,$definitionSuffix), $inlineSuffix, '.xml')" />
        
</xslt:when>
        
<xslt:when test="$isDeclaration">
          
<xslt:value-of select="concat(substring-before($filename,$declarationSuffix), $inlineSuffix, '.xml')" />
        
</xslt:when>
      
</xslt:choose>
    
</xslt:variable>
  
</xsl:template>
</xsl:stylesheet>






































v