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:wl="http://wolnelektury.pl/functions"
4 xmlns:dc="http://purl.org/dc/elements/1.1/" >
5 <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration = "yes" version="2.0" />
7 <xsl:template match="section">
9 <xsl:when test="not(ancestor::*)">
10 <utwor xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wl="http://wolnelektury.pl/functions">
11 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
13 <xsl:attribute name="rdf:about">
14 <xsl:text>http://redakcja.edukacjamedialna.edu.pl/documents/book/</xsl:text>
15 <xsl:value-of select="@redslug" />
16 <xsl:text>/</xsl:text>
18 <dc:title xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/"><xsl:apply-templates select="header/text()" /></dc:title>
19 <dc:identifier.url xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">
20 <xsl:text>http://edukacjamedialna.edu.pl/lekcje/</xsl:text>
21 <xsl:value-of select="@wlslug" />
22 <xsl:text>/</xsl:text>
25 <!--dc:creator.expert xml:lang="pl" ></dc:creator.expert>
26 <dc:creator.methodologist xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/"></dc:creator.methodologist>
27 <dc:creator.scenario xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/"></dc:creator.scenario>
28 <dc:creator.textbook xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/"></dc:creator.textbook-->
30 <xsl:apply-templates select="metadata" mode="meta" />
32 <dc:publisher xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">Fundacja Nowoczesna Polska</dc:publisher>
33 <dc:rights xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">Creative Commons Uznanie autorstwa - Na tych samych warunkach 3.0</dc:rights>
34 <dc:rights.license xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">http://creativecommons.org/licenses/by-sa/3.0/</dc:rights.license>
35 <dc:format xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">xml</dc:format>
36 <!--dc:type xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">added-var</dc:type-->
37 <dc:date xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">2015-01-12</dc:date>
38 <!--dc:audience xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/"><!- -liceum - -><xsl:value-of select="//dc:audience/text()" /></dc:audience-->
39 <dc:language xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">pol</dc:language>
43 <xsl:apply-templates />
47 <xsl:when test="count(ancestor::*) = 3">
49 <opis><xsl:apply-templates select="header" /><xsl:apply-templates select="div" mode="opis" /></opis>
50 <xsl:apply-templates select="div" mode="aktywnosc" />
51 <xsl:apply-templates select="section" mode="error" />
54 <xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
58 <!-- TODO language-dependent: description, audience, requires (subject.competence?) -->
59 <xsl:template 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" mode="meta">
60 <xsl:copy><xsl:apply-templates /></xsl:copy>
63 <xsl:template match="metadata"/>
64 <xsl:template match="aside">
65 <xsl:if test="@class = 'gap'">
66 <luka><xsl:apply-templates/></luka>
71 <xsl:template match="header">
73 <xsl:when test="count(ancestor::*) = 1">
74 <nazwa_utworu><xsl:apply-templates /></nazwa_utworu>
76 <xsl:when test="count(ancestor::*) = 2">
77 <naglowek_rozdzial><xsl:apply-templates /></naglowek_rozdzial>
79 <xsl:when test="count(ancestor::*) = 3">
80 <naglowek_podrozdzial><xsl:apply-templates /></naglowek_podrozdzial>
82 <xsl:when test="count(ancestor::*) = 4">
83 <akap><xsl:apply-templates /></akap>
89 <xsl:template match="div">
91 <xsl:when test="@class = 'p'">
92 <akap><xsl:apply-templates /></akap>
94 <xsl:when test="@class = 'list'">
95 <lista typ="punkt"><xsl:apply-templates /></lista>
97 <xsl:when test="@class = 'list.itemized'">
98 <lista typ="punkt"><xsl:apply-templates /></lista>
100 <xsl:when test="@class = 'list.enum'">
101 <lista typ="num"><xsl:apply-templates /></lista>
103 <xsl:when test="@class = 'list.definitions'">
105 <xsl:when test="@src = ''">
106 <lista typ="slowniczek"><xsl:apply-templates /></lista>
109 <lista typ="slowniczek" src="{@src}"><xsl:apply-templates /></lista>
113 <xsl:when test="@class = 'list.bibliography'">
114 <lista typ="czytelnia"><xsl:apply-templates /></lista>
116 <xsl:when test="@class = 'item'">
117 <punkt><xsl:apply-templates /></punkt>
119 <xsl:when test="@class = 'defined'">
121 <xsl:when test="count(ancestor::*) = 4 ">
122 <definiendum><xsl:apply-templates /></definiendum>
128 <xsl:when test="@class = 'exercise.order'">
129 <cwiczenie typ="uporzadkuj">
130 <xsl:for-each select="div">
132 <xsl:when test="@class = 'p'">
133 <opis><akap><xsl:apply-templates/></akap></opis>
135 <xsl:when test="@class = 'list.orderable'">
137 <xsl:apply-templates select="div" mode="exercise.order.list"/>
144 <xsl:when test="@class = 'exercise.choice.true-or-false'">
145 <cwiczenie typ="prawdafalsz">
146 <xsl:for-each select="div">
148 <xsl:when test="@class = 'p'">
149 <opis><akap><xsl:apply-templates/></akap></opis>
151 <xsl:when test="@class = 'list'">
153 <xsl:apply-templates select="div" mode="exercise.true-or-false"/>
160 <xsl:when test="@class = 'exercise.gap'">
161 <cwiczenie typ="luki">
162 <opis><akap>Uzupełnij luki:</akap></opis>
163 <xsl:apply-templates/>
166 <xsl:when test="@class = 'exercise.replace'">
167 <cwiczenie typ="zastap">
168 <opis><akap>Znajdź i zamień niepasujące słowa w zdaniach na następujące:</akap></opis>
169 <xsl:apply-templates/>
173 <NIEZNANY_DIV><xsl:value-of select="@class" /></NIEZNANY_DIV>
178 <xsl:template match="div" mode="opis">
180 <xsl:when test="@class = 'p'">
181 <akap><xsl:apply-templates /></akap>
183 <xsl:when test="@class = 'list'">
184 <lista typ="punkt"><xsl:apply-templates /></lista>
186 <xsl:when test="@class = 'list.itemized'">
187 <lista typ="punkt"><xsl:apply-templates /></lista>
189 <xsl:when test="@class = 'item'">
190 <punkt><xsl:apply-templates /></punkt>
195 <xsl:template match="div" mode="aktywnosc">
197 <xsl:when test="@class = 'list.definitions'">
198 <xsl:apply-templates mode="defs" />
204 <xsl:template match="div" mode="defs">
206 <xsl:when test="div/text() = 'Czas'"><czas><xsl:apply-templates /></czas></xsl:when>
207 <xsl:when test="div/text() = 'Metoda'"><forma><xsl:apply-templates /></forma></xsl:when>
208 <xsl:when test="div/text() = 'Pomoce'"><pomoce><xsl:apply-templates /></pomoce></xsl:when>
212 <xsl:template match="span">
214 <xsl:when test="@class = 'link'">
217 <xsl:when test="starts-with(@href, 'file://')">
218 <xsl:attribute name="material">
219 <xsl:value-of select="wl:rmext(substring(@href, 8))" />
222 <xsl:when test="starts-with(@href, 'http')">
223 <xsl:attribute name="url">
224 <xsl:value-of select="@href" />
228 <xsl:attribute name="url">
229 <xsl:value-of select="text()" />
233 <xsl:apply-templates />
236 <xsl:when test="@class = 'emp'">
237 <wyroznienie><xsl:apply-templates /></wyroznienie>
239 <xsl:when test="@class = 'cite'">
240 <dlugi_cytat><xsl:apply-templates /></dlugi_cytat>
242 <xsl:when test="@class = 'answer'">
243 <zastap rozw="{@answer}"><xsl:apply-templates/></zastap>
246 <NIEZNANY_SPAN><xsl:value-of select="@class" /></NIEZNANY_SPAN>
251 <xsl:template match="div" mode="exercise.order.list">
252 <punkt rozw="{@answer}"><xsl:apply-templates/></punkt>
255 <xsl:template match="div" mode="exercise.true-or-false">
256 <xsl:element name="punkt">
258 <xsl:when test="@answer = 'true'">
259 <xsl:attribute name="rozw">prawda</xsl:attribute>
261 <xsl:when test="@answer = 'false'">
262 <xsl:attribute name="rozw">falsz</xsl:attribute>
265 <xsl:apply-templates/>
269 <xsl:template match="section" mode="error">