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"></xsl:template>
64 <xsl:template match="aside"></xsl:template>
67 <xsl:template match="header">
69 <xsl:when test="count(ancestor::*) = 1">
70 <nazwa_utworu><xsl:apply-templates /></nazwa_utworu>
72 <xsl:when test="count(ancestor::*) = 2">
73 <naglowek_rozdzial><xsl:apply-templates /></naglowek_rozdzial>
75 <xsl:when test="count(ancestor::*) = 3">
76 <naglowek_podrozdzial><xsl:apply-templates /></naglowek_podrozdzial>
78 <xsl:when test="count(ancestor::*) = 4">
79 <akap><xsl:apply-templates /></akap>
85 <xsl:template match="div">
87 <xsl:when test="@class = 'p'">
88 <akap><xsl:apply-templates /></akap>
90 <xsl:when test="@class = 'list'">
91 <lista typ="punkt"><xsl:apply-templates /></lista>
93 <xsl:when test="@class = 'list.itemized'">
94 <lista typ="punkt"><xsl:apply-templates /></lista>
96 <xsl:when test="@class = 'list.enum'">
97 <lista typ="num"><xsl:apply-templates /></lista>
99 <xsl:when test="@class = 'list.definitions'">
101 <xsl:when test="@src = ''">
102 <lista typ="slowniczek"><xsl:apply-templates /></lista>
105 <lista typ="slowniczek" src="{@src}"><xsl:apply-templates /></lista>
109 <xsl:when test="@class = 'list.bibliography'">
110 <lista typ="czytelnia"><xsl:apply-templates /></lista>
112 <xsl:when test="@class = 'item'">
113 <punkt><xsl:apply-templates /></punkt>
115 <xsl:when test="@class = 'defined'">
117 <xsl:when test="count(ancestor::*) = 4 ">
118 <definiendum><xsl:apply-templates /></definiendum>
124 <xsl:when test="@class = 'exercise.order'">
125 <cwiczenie typ="uporzadkuj">
126 <xsl:for-each select="div">
128 <xsl:when test="@class = 'p'">
129 <opis><akap><xsl:value-of select="."/></akap></opis>
131 <xsl:when test="@class = 'list.orderable'">
133 <xsl:apply-templates select="div" mode="exercise.order.list"/>
140 <xsl:when test="@class = 'exercise.choice.true-or-false'">
141 <cwiczenie typ="prawdafalsz">
142 <xsl:for-each select="div">
144 <xsl:when test="@class = 'p'">
145 <opis><akap><xsl:value-of select="."/></akap></opis>
147 <xsl:when test="@class = 'list'">
149 <xsl:apply-templates select="div" mode="exercise.true-or-false"/>
157 <NIEZNANY_DIV><xsl:value-of select="@class" /></NIEZNANY_DIV>
162 <xsl:template match="div" mode="opis">
164 <xsl:when test="@class = 'p'">
165 <akap><xsl:apply-templates /></akap>
167 <xsl:when test="@class = 'list'">
168 <lista typ="punkt"><xsl:apply-templates /></lista>
170 <xsl:when test="@class = 'list.itemized'">
171 <lista typ="punkt"><xsl:apply-templates /></lista>
173 <xsl:when test="@class = 'item'">
174 <punkt><xsl:apply-templates /></punkt>
179 <xsl:template match="div" mode="aktywnosc">
181 <xsl:when test="@class = 'list.definitions'">
182 <xsl:apply-templates mode="defs" />
188 <xsl:template match="div" mode="defs">
190 <xsl:when test="div/text() = 'Czas'"><czas><xsl:apply-templates /></czas></xsl:when>
191 <xsl:when test="div/text() = 'Metoda'"><forma><xsl:apply-templates /></forma></xsl:when>
192 <xsl:when test="div/text() = 'Pomoce'"><pomoce><xsl:apply-templates /></pomoce></xsl:when>
196 <xsl:template match="span">
198 <xsl:when test="@class = 'link'">
201 <xsl:when test="starts-with(@href, 'file://')">
202 <xsl:attribute name="material">
203 <xsl:value-of select="wl:rmext(substring(@href, 8))" />
206 <xsl:when test="starts-with(@href, 'http')">
207 <xsl:attribute name="url">
208 <xsl:value-of select="@href" />
212 <xsl:attribute name="url">
213 <xsl:value-of select="text()" />
217 <xsl:apply-templates />
220 <xsl:when test="@class = 'emp'">
221 <wyroznienie><xsl:apply-templates /></wyroznienie>
223 <xsl:when test="@class = 'cite'">
224 <dlugi_cytat><xsl:apply-templates /></dlugi_cytat>
227 <NIEZNANY_SPAN><xsl:value-of select="@class" /></NIEZNANY_SPAN>
232 <xsl:template match="div" mode="exercise.order.list">
233 <punkt rozw="{@answer}"><xsl:value-of select="."/></punkt>
236 <xsl:template match="div" mode="exercise.true-or-false">
237 <xsl:element name="punkt">
239 <xsl:when test="@answer = 'true'">
240 <xsl:attribute name="rozw">prawda</xsl:attribute>
242 <xsl:when test="@answer = 'false'">
243 <xsl:attribute name="rozw">falsz</xsl:attribute>
246 <xsl:value-of select="."/>
250 <xsl:template match="section" mode="error">