xref: /trunk/main/readlicense_oo/docs/readme.xsl (revision 6df8b7a9)
1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
28eb6fccdSAndrew Rist<!--***********************************************************
3*6df8b7a9SMatthias Seidel *
48eb6fccdSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
58eb6fccdSAndrew Rist * or more contributor license agreements.  See the NOTICE file
68eb6fccdSAndrew Rist * distributed with this work for additional information
78eb6fccdSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
88eb6fccdSAndrew Rist * to you under the Apache License, Version 2.0 (the
98eb6fccdSAndrew Rist * "License"); you may not use this file except in compliance
108eb6fccdSAndrew Rist * with the License.  You may obtain a copy of the License at
11*6df8b7a9SMatthias Seidel *
128eb6fccdSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
13*6df8b7a9SMatthias Seidel *
148eb6fccdSAndrew Rist * Unless required by applicable law or agreed to in writing,
158eb6fccdSAndrew Rist * software distributed under the License is distributed on an
168eb6fccdSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
178eb6fccdSAndrew Rist * KIND, either express or implied.  See the License for the
188eb6fccdSAndrew Rist * specific language governing permissions and limitations
198eb6fccdSAndrew Rist * under the License.
20*6df8b7a9SMatthias Seidel *
218eb6fccdSAndrew Rist ***********************************************************-->
22cdf0e10cSrcweir
23cdf0e10cSrcweir<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
24cdf0e10cSrcweir
252f468b97SMatthias Seidel<!-- <xsl:output method="text" doctype-public="-//W3C//DTD HTML 3.2//EN" omit-xml-declaration="yes"/> -->
262f468b97SMatthias Seidel
272f468b97SMatthias Seidel	<!-- inputvariable declaration -->
28cdf0e10cSrcweir	<xsl:param name="os1"/>
29cdf0e10cSrcweir	<xsl:param name="gui1"/>
30cdf0e10cSrcweir	<xsl:param name="cp1"/>
31cdf0e10cSrcweir	<xsl:param name="com1"/>
32cdf0e10cSrcweir	<xsl:param name="lang1"/>
33cdf0e10cSrcweir	<xsl:param name="type"/>
34cdf0e10cSrcweir	<xsl:param name="file"/>
35cdf0e10cSrcweir	<xsl:strip-space elements="*"/>
36*6df8b7a9SMatthias Seidel
37cdf0e10cSrcweir	<xsl:param name="platform">
38cdf0e10cSrcweir		<xsl:if test="$os1='LINUX'">
39cdf0e10cSrcweir			<xsl:value-of select="'LINUX'"/>
40cdf0e10cSrcweir		</xsl:if>
41cdf0e10cSrcweir		<xsl:if test="$os1='WNT'">
42cdf0e10cSrcweir			<xsl:value-of select="'WIN'"/>
43cdf0e10cSrcweir		</xsl:if>
44cdf0e10cSrcweir		<xsl:if test="$os1='SOLARIS'">
45cdf0e10cSrcweir			<xsl:if test="$cp1='SPARC'">
46cdf0e10cSrcweir				<xsl:value-of select="'SOLSPARC'"/>
47cdf0e10cSrcweir			</xsl:if>
48cdf0e10cSrcweir			<xsl:if test="$cp1='INTEL'">
49cdf0e10cSrcweir				<xsl:value-of select="'SOLX86'"/>
50cdf0e10cSrcweir			</xsl:if>
51cdf0e10cSrcweir		</xsl:if>
52cdf0e10cSrcweir		<xsl:if test="$os1='MACOSX'">
53cdf0e10cSrcweir			<xsl:value-of select="'MAC'"/>
54cdf0e10cSrcweir		</xsl:if>
55cdf0e10cSrcweir	</xsl:param>
56*6df8b7a9SMatthias Seidel
57cdf0e10cSrcweir	<xsl:param name="lf">
58cdf0e10cSrcweir		<xsl:choose>
59cdf0e10cSrcweir			<xsl:when test="$platform='WIN'"><xsl:text>&#xD;&#xA;</xsl:text></xsl:when>
60cdf0e10cSrcweir			<xsl:otherwise><xsl:text>&#xA;</xsl:text></xsl:otherwise>
61cdf0e10cSrcweir		</xsl:choose>
62cdf0e10cSrcweir	</xsl:param>
63*6df8b7a9SMatthias Seidel
64cdf0e10cSrcweir	<xsl:template match="/">
65cdf0e10cSrcweir		<xsl:choose>
66cdf0e10cSrcweir			<xsl:when test="$type='html'">
67*6df8b7a9SMatthias Seidel
68cdf0e10cSrcweir				<xsl:document method="html" href="{$file}" doctype-public="-//W3C//DTD HTML 3.2//EN">
69cdf0e10cSrcweir					<xsl:apply-templates mode="html"/>
70cdf0e10cSrcweir				</xsl:document>
71*6df8b7a9SMatthias Seidel
72cdf0e10cSrcweir			</xsl:when>
73cdf0e10cSrcweir			<xsl:when test="$type='text'">
74*6df8b7a9SMatthias Seidel
75cdf0e10cSrcweir				<xsl:document method="text" href="{$file}">
76cdf0e10cSrcweir					<xsl:call-template name="textout" />
77cdf0e10cSrcweir				</xsl:document>
78*6df8b7a9SMatthias Seidel
79cdf0e10cSrcweir			</xsl:when>
80cdf0e10cSrcweir		</xsl:choose>
81cdf0e10cSrcweir	</xsl:template>
82*6df8b7a9SMatthias Seidel
83cdf0e10cSrcweir	<xsl:template match="*" mode="html">
84cdf0e10cSrcweir		<xsl:choose>
85cdf0e10cSrcweir			<xsl:when test="(contains(@class,$platform) or not(@class) or (name(.)='p'))">
86cdf0e10cSrcweir				<xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
87cdf0e10cSrcweir					<xsl:element name="{name(.)}">
88cdf0e10cSrcweir						<xsl:if test="(name(.)='a')">
89cdf0e10cSrcweir							<xsl:attribute name="href">
90cdf0e10cSrcweir								<xsl:value-of select="@href"/>
91cdf0e10cSrcweir							</xsl:attribute>
92cdf0e10cSrcweir						</xsl:if>
93cdf0e10cSrcweir						<xsl:if test="(name(.)='p') and (@class)">
94cdf0e10cSrcweir							<xsl:attribute name="class">
95cdf0e10cSrcweir								<xsl:value-of select="@class"/>
96cdf0e10cSrcweir							</xsl:attribute>
97cdf0e10cSrcweir						</xsl:if>
98cdf0e10cSrcweir						<xsl:if test="name(.)='div'">
99cdf0e10cSrcweir							<xsl:attribute name="id">
100cdf0e10cSrcweir								<xsl:value-of select="@id"/>
101cdf0e10cSrcweir							</xsl:attribute>
102cdf0e10cSrcweir						</xsl:if>
103cdf0e10cSrcweir						<xsl:apply-templates mode="html"/>
104cdf0e10cSrcweir					</xsl:element>
105cdf0e10cSrcweir				</xsl:if>
106cdf0e10cSrcweir			</xsl:when>
107cdf0e10cSrcweir			<xsl:otherwise>
108*6df8b7a9SMatthias Seidel
109cdf0e10cSrcweir			</xsl:otherwise>
110cdf0e10cSrcweir		</xsl:choose>
111cdf0e10cSrcweir	</xsl:template>
112*6df8b7a9SMatthias Seidel
113cdf0e10cSrcweir	<xsl:template name="textout">
114cdf0e10cSrcweir		<xsl:apply-templates />
115cdf0e10cSrcweir	</xsl:template>
116*6df8b7a9SMatthias Seidel
117cdf0e10cSrcweir	<xsl:template match="*">
118cdf0e10cSrcweir		<xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
119cdf0e10cSrcweir		<xsl:choose>
120cdf0e10cSrcweir			<xsl:when test="name(.)='html'">
121cdf0e10cSrcweir				<xsl:apply-templates/>
122cdf0e10cSrcweir			</xsl:when>
123cdf0e10cSrcweir			<xsl:when test="name(.)='body'">
124cdf0e10cSrcweir				<xsl:apply-templates/>
125cdf0e10cSrcweir			</xsl:when>
126cdf0e10cSrcweir			<xsl:when test="name(.)='hr'">
127cdf0e10cSrcweir				<xsl:text>
128*6df8b7a9SMatthias Seidel
129cdf0e10cSrcweir----------------------------------------------------------------------------------------------------------
130cdf0e10cSrcweir
131cdf0e10cSrcweir</xsl:text>
132cdf0e10cSrcweir			</xsl:when>
133cdf0e10cSrcweir			<xsl:when test="name(.)='div'">
134cdf0e10cSrcweir				<xsl:if test="(contains(@class,$platform) or not(@class))">
135cdf0e10cSrcweir					<xsl:apply-templates/>
136cdf0e10cSrcweir				</xsl:if>
137cdf0e10cSrcweir			</xsl:when>
138cdf0e10cSrcweir			<xsl:when test="name(.)='a'">
139cdf0e10cSrcweir				<xsl:apply-templates/>
140cdf0e10cSrcweir			</xsl:when>
141cdf0e10cSrcweir			<xsl:when test="name(.)='tt'">
142cdf0e10cSrcweir				<xsl:apply-templates/>
143cdf0e10cSrcweir			</xsl:when>
144cdf0e10cSrcweir			<xsl:when test="name(.)='li'">
145cdf0e10cSrcweir				<xsl:value-of select="$lf"/>* <xsl:apply-templates/>
146cdf0e10cSrcweir			</xsl:when>
147cdf0e10cSrcweir			<xsl:when test="name(.)='ul'">
148cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
149cdf0e10cSrcweir				<xsl:apply-templates/>
150cdf0e10cSrcweir			</xsl:when>
151cdf0e10cSrcweir			<xsl:when test="name(.)='ol'">
152cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
153cdf0e10cSrcweir				<xsl:apply-templates/>
154cdf0e10cSrcweir			</xsl:when>
155cdf0e10cSrcweir			<xsl:when test="name(.)='p'">
156cdf0e10cSrcweir				<xsl:if test="(not(name(..)='li') and (count(a) = 0))">
157cdf0e10cSrcweir					<xsl:value-of select="$lf"/>
158cdf0e10cSrcweir					<xsl:value-of select="$lf"/>
159cdf0e10cSrcweir				</xsl:if>
160cdf0e10cSrcweir				<xsl:apply-templates/>
161cdf0e10cSrcweir			</xsl:when>
162cdf0e10cSrcweir			<xsl:when test="name(.)='h1'">
163cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
164*6df8b7a9SMatthias Seidel				<xsl:text>===================================================================</xsl:text>
165cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
166cdf0e10cSrcweir				<xsl:apply-templates/>
167cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
168*6df8b7a9SMatthias Seidel				<xsl:text>===================================================================</xsl:text>
169cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
170cdf0e10cSrcweir			</xsl:when>
171cdf0e10cSrcweir			<xsl:when test="name(.)='h2'">
172cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
173cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
174cdf0e10cSrcweir				<xsl:text>----------------------------------------------------------------------</xsl:text>
175cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
176cdf0e10cSrcweir				<xsl:apply-templates/>
177cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
178cdf0e10cSrcweir				<xsl:text>----------------------------------------------------------------------</xsl:text>
179cdf0e10cSrcweir			</xsl:when>
180cdf0e10cSrcweir			<xsl:when test="name(.)='h3'">
181cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
182cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
183cdf0e10cSrcweir				<xsl:apply-templates/>
184cdf0e10cSrcweir				<xsl:value-of select="$lf"/>
185cdf0e10cSrcweir				<xsl:text>----------------------------------------------------------------------</xsl:text>
186cdf0e10cSrcweir			</xsl:when>
187cdf0e10cSrcweir		</xsl:choose>
188cdf0e10cSrcweir	</xsl:if>
189cdf0e10cSrcweir	</xsl:template>
190cdf0e10cSrcweir
191cdf0e10cSrcweir</xsl:stylesheet>
192