source: documentation/trunk/tutorials/processing/xml-to-one-html.xsl@ 14545

Last change on this file since 14545 was 13638, checked in by kjdon, 17 years ago

xsl transform files copied from gsdl-tutorials repository

  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:include href="common.xsl"/>
6 <xsl:output method="html"/>
7 <!-- set mode to cd/web depending on where the files will end up -->
8 <xsl:variable name="mode">web</xsl:variable>
9
10 <xsl:template match="TutorialList">
11 <html>
12 <head>
13 <title><xsl:apply-templates select="Title/Text"/></title>
14 </head>
15 <body>
16 <h2><xsl:apply-templates select="Title/Text"/></h2>
17 <h3><xsl:apply-templates select="SupplementaryText/Text[@id='current']"/><xsl:text> </xsl:text><xsl:value-of select="Version/@current"/></h3>
18 <xsl:apply-templates select="Comment"/>
19 <a name="index"/>
20 <dl>
21 <xsl:apply-templates select="Tutorial[not(@hidden)]" mode="index"/>
22 </dl>
23 <xsl:apply-templates select="Tutorial[not(@hidden)]"/>
24 </body>
25 </html>
26 </xsl:template>
27
28 <xsl:template match="Tutorial" mode="index">
29 <dt><a href="#{@id}"><xsl:apply-templates select="Title/Text"/></a></dt>
30 <dd><xsl:for-each select="Content/Heading">
31 <xsl:apply-templates/><br/>
32 </xsl:for-each>
33 </dd>
34 </xsl:template>
35
36 <xsl:template match="Tutorial">
37 <a name="{@id}"/>
38 <h2><xsl:apply-templates select="Title/Text"/></h2>
39 <div style="text-align:right;">
40 <xsl:call-template name="supplementary">
41 <xsl:with-param name="mode" select="$mode"/>
42 </xsl:call-template>
43 </div>
44 <xsl:apply-templates select="Content/*"/>
45 <br/>
46 <br/>
47 </xsl:template>
48
49 <xsl:template name="supplementary">
50 <xsl:param name="mode">web</xsl:param>
51 <xsl:call-template name="IndexLink">
52 <xsl:with-param name="mode">combined</xsl:with-param>
53 </xsl:call-template>
54 <xsl:apply-templates select="Prerequisite" mode="combined"/>
55 <xsl:if test="SampleFiles">
56 <xsl:call-template name="SampleFiles">
57 <xsl:with-param name="mode"><xsl:value-of select="$mode"/></xsl:with-param>
58 </xsl:call-template>
59 </xsl:if>
60 <xsl:apply-templates select="Version"/>
61 </xsl:template>
62
63</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.