Changeset 26439


Ignore:
Timestamp:
2012-11-02T06:35:40+13:00 (11 years ago)
Author:
davidb
Message:

Some additional useful gsf:xx templates. One for including scripts, the other for CSS style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/config_format.xsl

    r26387 r26439  
    4646        <xslt:call-template name="defaultClassifierNode"/>
    4747    </xsl:template>
     48
     49
     50    <xsl:template match="gsf:script[@src]">
     51      <script>
     52        <xsl:attribute name='src'>
     53          <xsl:value-of select="@src"/>     
     54        </xsl:attribute>
     55        <xslt:attribute name='type'>text/javascript</xslt:attribute>
     56        <xslt:comment></xslt:comment><!-- comment used to ensure script tag is not collapsed -->
     57      </script>
     58    </xsl:template>
     59
     60
     61    <xsl:template match="gsf:script">
     62      <script type="text/javascript">
     63        <xslt:text disable-output-escaping="yes">
     64          <xsl:apply-templates/>
     65        </xslt:text>
     66      </script>
     67    </xsl:template>
     68
     69
     70    <xsl:template match="gsf:style[@src]">
     71      <link rel="stylesheet" type="text/css">
     72        <xsl:attribute name='href'>
     73          <xsl:value-of select="@src"/>     
     74        </xsl:attribute>
     75      </link>
     76    </xsl:template>
     77
     78    <xsl:template match="gsf:style">
     79      <style type="text/css">
     80          <xsl:apply-templates/>
     81      </style>
     82    </xsl:template>
     83
    4884
    4985    <xsl:template match="gsf:image">
Note: See TracChangeset for help on using the changeset viewer.