Changeset 197

Show
Ignore:
Timestamp:
02/02/07 08:51:58 (1 year ago)
Author:
nsteiner
Message:

stub:maincontent xsl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/experiments/general/xsl/stub.xsl

    r190 r197  
    99    <a> 
    1010      <xsl:attribute name="href"> 
    11         <xsl:text>/link/to/project/</xsl:text
     11        <xsl:value-of select="$__path"/
    1212        <xsl:value-of select="@page"/> 
     13        <xsl:value-of select="$__sessionid"/> 
    1314      </xsl:attribute> 
    1415      <xsl:value-of select="."/> 
     
    1617  </xsl:template> 
    1718   
    18   <xsl:template match="stub:include">     
     19  <xsl:template match="stub:maincontent"> 
     20        <xsl:variable name="path"> 
     21      <xsl:choose> 
     22        <xsl:when test="@path"> 
     23          <xsl:value-of select="@path"/> 
     24        </xsl:when> 
     25        <xsl:otherwise> 
     26          <xsl:text></xsl:text> 
     27        </xsl:otherwise> 
     28      </xsl:choose> 
     29    </xsl:variable> 
     30        <xsl:variable name="prefix"> 
     31      <xsl:choose> 
     32        <xsl:when test="@prefix"> 
     33          <xsl:value-of select="@prefix"/> 
     34        </xsl:when> 
     35        <xsl:otherwise> 
     36          <xsl:text>main_</xsl:text> 
     37        </xsl:otherwise> 
     38      </xsl:choose> 
     39    </xsl:variable> 
     40        <xsl:variable name="suffix"> 
     41      <xsl:choose> 
     42        <xsl:when test="@suffix"> 
     43          <xsl:value-of select="@suffix"/> 
     44        </xsl:when> 
     45        <xsl:otherwise> 
     46          <xsl:text>.xml</xsl:text> 
     47        </xsl:otherwise> 
     48      </xsl:choose> 
     49    </xsl:variable> 
     50        <xsl:variable name="part"> 
     51      <xsl:choose> 
     52        <xsl:when test="@part"> 
     53          <xsl:value-of select="@part"/> 
     54        </xsl:when> 
     55        <xsl:otherwise> 
     56          <xsl:text>content</xsl:text> 
     57        </xsl:otherwise> 
     58      </xsl:choose> 
     59    </xsl:variable> 
     60    <xsl:call-template name="stub:include"> 
     61      <xsl:with-param name="href"> 
     62        <xsl:value-of select="$path"/> 
     63        <xsl:value-of select="$prefix"/> 
     64        <xsl:value-of select="$page"/> 
     65        <xsl:value-of select="$suffix"/> 
     66      </xsl:with-param> 
     67      <xsl:with-param name="part" select="$part"/> 
     68    </xsl:call-template>   
     69  </xsl:template> 
     70   
     71  <xsl:template match="stub:include" name="stub:include">     
    1972    <xsl:param name="href" select="@href"/> 
    2073    <xsl:param name="part" select="@part"/>     
  • trunk/experiments/general/xsl/test.xml

    r185 r197  
    33<html> 
    44  <body> 
    5     <stub:link page="testlinkPage">Das ist ein Stubbles-Link</stub:link> 
    6     <stub:include href="parts.xml" part="frank"/> 
    7     <stub:image src="stubbles.png" alt="Stubbles Logo"/> 
     5    <stub:maincontent part="content" path=""/> 
    86  </body> 
    97</html> 
  • trunk/experiments/general/xsl/test.xsl

    r184 r197  
    55    xmlns:stub="http://stubbles.org/stub" 
    66    exclude-result-prefixes="php xi stub"> 
    7    
     7 
    88  <xsl:import href="copy.xsl"/> 
    99  <xsl:import href="stub.xsl"/> 
    1010   
     11  <xsl:param name="__path"></xsl:param> 
     12  <xsl:param name="__sessionid"></xsl:param> 
     13  <xsl:param name="page">home</xsl:param> 
     14     
    1115  <xsl:param name="owner" select="'Frank Kleine'"/> 
    1216  <xsl:output method="html" encoding="iso-8859-1" indent="no"/> 
     
    1620  </xsl:template> 
    1721   
    18   <!-- 
    19   <xsl:template match="collection"> 
    20     <xsl:copy-of select="php:function('stubXSLCallback::invoke', 'say', 'hello', 'Nico Steiner')"/> Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection!  
    21     <xsl:apply-templates/> 
    22   </xsl:template> 
    23    
    24   <xsl:template match="cd"> 
    25     <h1><xsl:value-of select="title"/></h1> 
    26     <h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> 
    27     <hr /> 
    28   </xsl:template> 
    29   --> 
    30  
    3122</xsl:stylesheet>