1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:dc="http://purl.org/dc/elements/1.1/"
4 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
5 exclude-result-prefixes="rdf">
6 <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration="yes" version="2.0"/>
8 <xsl:template match="utwor">
9 <section xmlns:dc="http://purl.org/dc/elements/1.1/">
10 <xsl:apply-templates/>
14 <xsl:template match="rdf:RDF">
15 <xsl:apply-templates/>
18 <xsl:template match="rdf:Description">
20 <xsl:apply-templates mode="meta"/>
25 match="dc:title|dc:identifier.url|dc:publisher|dc:rights|dc:rights.license|dc:format|dc:date|dc:language|dc:description.material|dc:relation.isPartOf"
28 <!-- TODO language-dependent: description, audience, requires (subject.competence?) -->
30 match="dc:creator.expert|dc:creator.scenario|dc:creator.textbook|dc:description|dc:subject.curriculum|dc:creator.methodologist|dc:subject.competence|dc:audience|dc:type|dc:requires|dc:relation|dc:subject|dc:publisher|dc:date"
33 <xsl:apply-templates/>
37 <xsl:template match="powiesc">
38 <xsl:apply-templates select="nazwa_utworu"/>
39 <xsl:apply-templates select="naglowek_rozdzial"/>
42 <xsl:template match="nazwa_utworu">
44 <xsl:apply-templates mode="tekst"/>
48 <xsl:key name="k_rozdzial"
49 match="naglowek_podrozdzial"
50 use="generate-id(preceding-sibling::naglowek_rozdzial[1])"/>
52 <xsl:key name="k_last_header"
53 match="*[not(starts-with(name(),'naglowek_'))]"
54 use="generate-id(preceding-sibling::*[starts-with(name(),'naglowek_')][1])"/>
56 <xsl:template match="naglowek_rozdzial">
58 <xsl:if test="contains(./text(), 'Pomysł na lekcję')">
59 <metadata><dc:audience>teacher</dc:audience></metadata>
61 <header><xsl:apply-templates mode="tekst"/></header>
62 <xsl:apply-templates select="key('k_last_header', generate-id())" mode="rozdzial"/>
63 <xsl:apply-templates select="key('k_rozdzial', generate-id())" mode="rozdzial"/>
67 <xsl:template match="naglowek_podrozdzial" mode="rozdzial">
69 <header><xsl:apply-templates mode="tekst"/></header>
70 <xsl:apply-templates select="key('k_last_header', generate-id())" mode="rozdzial"/>
74 <xsl:template match="akap" mode="rozdzial">
75 <div class="p"><xsl:apply-templates mode="tekst"/></div>
78 <xsl:template match="akap" mode="opis">
79 <header><xsl:number format="1. " count="aktywnosc"/><xsl:apply-templates mode="tekst"/></header>
82 <xsl:template match="opis" mode="rozdzial">
83 <xsl:apply-templates mode="rozdzial"/>
86 <xsl:template match="akap" mode="tekst"><!-- for akap inside punkt -->
87 <xsl:apply-templates select="." mode="rozdzial"/>
90 <xsl:template match="uwaga" mode="rozdzial">
91 <aside class="comment"><xsl:apply-templates mode="tekst"/></aside>
93 <xsl:template match="uwaga" mode="tekst">
94 <xsl:apply-templates select="." mode="rozdzial"/>
96 <xsl:template match="uwaga" mode="lista">
97 <div class="item"><xsl:apply-templates select="." mode="rozdzial"/></div>
100 <xsl:template match="text()[normalize-space()]" mode="rozdzial">
101 <div class="p"><xsl:value-of select="normalize-space()"/></div>
104 <xsl:template match="lista" mode="rozdzial">
106 <xsl:attribute name="class">
108 <xsl:when test="@typ = 'punkt' or @nazwa or @cel">list</xsl:when>
109 <xsl:when test="@typ = 'num'">list.enum</xsl:when>
110 <xsl:when test="@typ = 'alfa'">list</xsl:when>
111 <xsl:when test="@typ = 'slowniczek'">list.definitions</xsl:when>
112 <xsl:when test="@typ = 'czytelnia'">list.bibliography</xsl:when>
115 <xsl:if test="@nazwa">
116 <xsl:attribute name="name"><xsl:value-of select="@nazwa"/></xsl:attribute>
119 <xsl:attribute name="dest"><xsl:value-of select="@cel"/></xsl:attribute>
121 <xsl:if test="@uchwyty">
122 <xsl:attribute name="handles"><xsl:value-of select="@uchwyty"/></xsl:attribute>
124 <xsl:if test="@krotkie">
125 <xsl:attribute name="short"><xsl:value-of select="@krotkie"/></xsl:attribute>
128 <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
130 <xsl:apply-templates mode="lista"/>
134 <xsl:template match="lista" mode="lista">
135 <xsl:apply-templates select="." mode="rozdzial"/>
138 <xsl:template match="lista" mode="tekst">
139 <xsl:apply-templates select="." mode="rozdzial"/>
142 <xsl:template match="punkt" mode="lista">
144 <xsl:when test="@rozw">
145 <div class="item.answer">
146 <xsl:attribute name="answer">
148 <xsl:when test="@rozw = 'prawda'">true</xsl:when>
149 <xsl:when test="@rozw = 'falsz'">false</xsl:when>
150 <xsl:otherwise><xsl:value-of select="@rozw"/></xsl:otherwise>
153 <xsl:apply-templates mode="tekst"/>
156 <xsl:when test="@nazwa">
157 <div class="item.category" name="{@nazwa}">
158 <xsl:apply-templates mode="tekst"/>
163 <xsl:apply-templates mode="tekst"/>
169 <xsl:template match="definiendum" mode="tekst">
170 <div class="defined">
171 <xsl:apply-templates mode="tekst"/>
175 <xsl:template match="dlugi_cytat" mode="rozdzial">
176 <div class="important">
177 <xsl:apply-templates mode="rozdzial"/>
181 <xsl:template match="obraz" mode="rozdzial">
182 <div class="img" name="{@nazwa}" alt="{@alt}"/>
185 <xsl:template match="obraz" mode="tekst"><!-- inside punkt -->
186 <xsl:apply-templates select="." mode="rozdzial"/>
189 <xsl:template match="video" mode="rozdzial">
190 <div class="video" src="{@url}"/>
193 <xsl:template match="podpis" mode="rozdzial">
195 <xsl:apply-templates mode="rozdzial"/>
199 <xsl:template match="strofa" mode="tekst">
200 <div class="verse"><xsl:apply-templates mode="tekst"/></div>
205 <xsl:template match="aktywnosc" mode="rozdzial">
207 <xsl:apply-templates select="opis/akap[1]" mode="opis"/>
208 <xsl:apply-templates select="opis/*[position() > 1]" mode="rozdzial"/>
209 <xsl:apply-templates select="akap|lista" mode="rozdzial"/>
210 <xsl:apply-templates select="wskazowki" mode="rozdzial"/>
211 <div class="list.definitions">
212 <xsl:apply-templates select="czas|forma|pomoce" mode="aktywnosc"/>
217 <xsl:template match="czas" mode="aktywnosc">
218 <div class="item"><div class="defined">Czas</div><xsl:apply-templates mode="tekst"/></div>
221 <xsl:template match="forma" mode="aktywnosc">
222 <div class="item"><div class="defined">Metoda</div><xsl:apply-templates mode="tekst"/></div>
225 <xsl:template match="pomoce" mode="aktywnosc">
226 <div class="item"><div class="defined">Pomoce</div><xsl:apply-templates mode="tekst"/></div>
229 <!-- inline elements -->
231 <xsl:template match="link" mode="tekst">
233 <xsl:attribute name="href">
235 <xsl:when test="@material">
236 <xsl:value-of select="concat('file://', @material)"/>
238 <xsl:when test="@url">
239 <xsl:value-of select="@url"/>
243 <xsl:apply-templates mode="tekst"/>
247 <xsl:template match="wyroznienie" mode="tekst">
249 <xsl:apply-templates mode="tekst"/>
253 <xsl:template match="tytul_dziela|slowo_obce" mode="tekst">
254 <span class="cite"><xsl:apply-templates mode="tekst"/></span>
259 <xsl:template match="cwiczenie" mode="rozdzial">
261 <xsl:when test="@typ = 'uporzadkuj'">
262 <div class="exercise.order">
263 <xsl:apply-templates select="opis/*" mode="rozdzial"/>
264 <div class="list.orderable">
265 <xsl:apply-templates select="lista/punkt" mode="lista"/>
269 <xsl:when test="@typ = 'prawdafalsz'">
270 <div class="exercise.choice.true-or-false">
271 <xsl:apply-templates mode="rozdzial"/>
274 <xsl:when test="@typ = 'luki'">
275 <div class="exercise.gap">
276 <xsl:apply-templates mode="rozdzial"/>
279 <xsl:when test="@typ = 'zastap'">
280 <div class="exercise.replace">
281 <xsl:apply-templates mode="rozdzial"/>
284 <xsl:when test="@typ = 'przyporzadkuj'">
285 <div class="exercise.match">
286 <xsl:apply-templates mode="rozdzial"/>
289 <xsl:when test="@typ = 'wybor'">
291 <xsl:attribute name="class">
294 test="count(.//pytanie) = count(.//punkt[@rozw='prawda']) or (count(.//pytanie) = 0 and count(.//punkt[@rozw='prawda']) = 1)">exercise.choice.single</xsl:when>
295 <xsl:otherwise>exercise.choice</xsl:otherwise>
298 <xsl:apply-templates mode="rozdzial"/>
304 <xsl:template match="luka" mode="tekst">
305 <aside class="gap"><xsl:apply-templates mode="tekst"/></aside>
308 <xsl:template match="zastap" mode="tekst">
309 <span class="answer" answer="{@rozw}"><xsl:apply-templates mode="tekst"/></span>
312 <xsl:template match="pytanie" mode="rozdzial">
313 <div class="question">
314 <xsl:apply-templates mode="rozdzial"/>
318 <xsl:template match="pytanie" mode="tekst">
319 <xsl:apply-templates select="." mode="rozdzial"/>
322 <xsl:template match="rozw_kom" mode="rozdzial">
323 <div class="solution.comment">
324 <xsl:apply-templates mode="rozdzial"/>
327 <xsl:template match="rozw_kom" mode="tekst">
328 <xsl:apply-templates select="." mode="rozdzial"/>
333 <xsl:template match="tabela" mode="rozdzial">
335 <xsl:apply-templates mode="tabela"/>
339 <xsl:template match="wiersz" mode="tabela">
340 <div class="table.row">
341 <xsl:apply-templates mode="wiersz"/>
345 <xsl:template match="kol" mode="wiersz">
346 <div class="table.cell">
347 <xsl:apply-templates mode="tekst"/>