add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / src / site / src / documentation / skins / lucene / xslt / html / document-to-html.xsl
1 <?xml version="1.0"?>
2 <!--
3   Licensed to the Apache Software Foundation (ASF) under one or more
4   contributor license agreements.  See the NOTICE file distributed with
5   this work for additional information regarding copyright ownership.
6   The ASF licenses this file to You under the Apache License, Version 2.0
7   (the "License"); you may not use this file except in compliance with
8   the License.  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17 -->
18 <!--
19 This stylesheet contains templates for converting documentv11 to HTML.  See the
20 imported document-to-html.xsl for details.
21 -->
22 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
23   <xsl:import href="../../../common/xslt/html/document-to-html.xsl"/>
24   <xsl:template match="document">
25     <meta-data>
26       <xsl:apply-templates select="header/meta"/>
27     </meta-data>
28     <div id="content">
29       <div id="skinconf-printlink"/>
30       <div id="skinconf-xmllink"/>
31       <div id="skinconf-podlink"/>
32       <div id="skinconf-txtlink"/>
33       <div id="skinconf-pdflink"/>
34       <div id="disable-font-script"/>
35       <xsl:if test="normalize-space(header/title)!=''">
36         <h1>
37           <xsl:value-of select="header/title"/>
38         </h1>
39       </xsl:if>
40       <xsl:if test="normalize-space(header/subtitle)!=''">
41         <h3>
42           <xsl:value-of select="header/subtitle"/>
43         </h3>
44       </xsl:if>
45 <!--
46       <xsl:apply-templates select="header/type"/>
47       <xsl:apply-templates select="header/notice"/>
48       <xsl:apply-templates select="header/abstract"/>
49       <xsl:apply-templates select="body"/>
50
51       <div class="attribution">
52         <xsl:apply-templates select="header/authors"/>
53         <xsl:if test="header/authors and header/version">
54           <xsl:text>; </xsl:text>
55         </xsl:if>
56         <xsl:apply-templates select="header/version"/>
57       </div>
58     -->
59       <xsl:if test="header/abstract">
60         <div class="abstract">
61           <xsl:value-of select="header/abstract"/>
62         </div>
63       </xsl:if>
64       <xsl:apply-templates select="body"/>
65       <xsl:if test="header/authors">
66         <p align="right">
67           <font size="-2">
68             <xsl:for-each select="header/authors/person">
69               <xsl:choose>
70                 <xsl:when test="position()=1">by&#160;</xsl:when>
71                 <xsl:otherwise>,&#160;</xsl:otherwise>
72               </xsl:choose>
73               <xsl:value-of select="@name"/>
74             </xsl:for-each>
75           </font>
76         </p>
77       </xsl:if>
78       <xsl:if test="header/version">
79         <xsl:apply-templates select="header/version"/>
80       </xsl:if>
81     </div>
82   </xsl:template>
83   <xsl:template match="body">
84     <div id="skinconf-toc-page"/>
85     <xsl:apply-templates/>
86   </xsl:template>
87   <xsl:template match="@id">
88     <xsl:apply-imports/>
89   </xsl:template>
90   <xsl:template match="section"><a name="{generate-id()}"/>
91     <xsl:apply-templates select="@id"/>
92     <xsl:variable name = "level" select = "count(ancestor::section)+1" />
93     <xsl:choose>
94       <xsl:when test="$level=1">
95         <div class="skinconf-heading-{$level}">
96           <h1>
97             <xsl:value-of select="title"/>
98           </h1>
99         </div>
100         <div class="section">
101           <xsl:apply-templates select="*[not(self::title)]"/>
102         </div>
103       </xsl:when>
104       <xsl:when test="$level=2">
105         <div class="skinconf-heading-{$level}">
106           <h2>
107             <xsl:value-of select="title"/>
108           </h2>
109         </div>
110         <xsl:apply-templates select="*[not(self::title)]"/>
111       </xsl:when>
112 <!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
113       <xsl:when test="$level=3 and $notoc='true'">
114         <h4 class="faq">
115           <xsl:value-of select="title"/>
116         </h4>
117         <div align="right"><a href="#{@id}-menu">^</a>
118         </div>
119         <div style="margin-left: 15px">
120           <xsl:apply-templates select="*[not(self::title)]"/>
121         </div>
122       </xsl:when>
123       <xsl:when test="$level=3">
124         <h4>
125           <xsl:value-of select="title"/>
126         </h4>
127         <xsl:apply-templates select="*[not(self::title)]"/>
128       </xsl:when>
129       <xsl:otherwise>
130         <h5>
131           <xsl:value-of select="title"/>
132         </h5>
133         <xsl:apply-templates select="*[not(self::title)]"/>
134       </xsl:otherwise>
135     </xsl:choose>
136   </xsl:template>
137   <xsl:template match="figure">
138     <xsl:apply-templates select="@id"/>
139     <div style="text-align: center;" id="{@id}">
140       <img src="{@src}" alt="{@alt}" class="figure"  id="{@id}">
141         <xsl:if test="@height">
142           <xsl:attribute name="height">
143             <xsl:value-of select="@height"/>
144           </xsl:attribute>
145         </xsl:if>
146         <xsl:if test="@width">
147           <xsl:attribute name="width">
148             <xsl:value-of select="@width"/>
149           </xsl:attribute>
150         </xsl:if>
151       </img>
152     </div>
153   </xsl:template>
154 </xsl:stylesheet>