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 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
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"
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:language"
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/>
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="./text() = 'Pomysł na lekcję'">
59 <metadata><dc:audience>teacher</dc:audience></metadata>
61 <header><xsl:apply-templates/></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/></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:apply-templates mode="tekst"/></header>
82 <xsl:template match="lista" mode="rozdzial">
84 <xsl:attribute name="class">
86 <xsl:when test="@typ = 'num'">list.enum</xsl:when>
87 <xsl:when test="@typ = 'punkt'">list</xsl:when>
88 <xsl:when test="@typ = 'slowniczek'">list.definitions</xsl:when>
89 <xsl:when test="@typ = 'czytelnia'">list.bibliography</xsl:when>
92 <xsl:if test="@src != ''">
93 <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
95 <xsl:apply-templates mode="lista"/>
99 <xsl:template match="lista" mode="tekst">
100 <xsl:apply-templates select="." mode="rozdzial"/>
103 <xsl:template match="punkt" mode="lista">
105 <xsl:apply-templates mode="tekst"/>
109 <xsl:template match="definiendum" mode="tekst">
110 <div class="defined">
111 <xsl:apply-templates mode="tekst"/>
115 <xsl:template match="aktywnosc" mode="rozdzial">
117 <xsl:apply-templates select="opis/akap[1]" mode="opis"/>
118 <xsl:apply-templates select="opis/*[position() > 1]" mode="rozdzial"/>
119 <xsl:apply-templates select="wskazowki" mode="rozdzial"/>
120 <div class="list.definitions">
121 <xsl:apply-templates mode="aktywnosc"/>
126 <xsl:template match="czas" mode="aktywnosc">
127 <div class="item"><div class="defined">Czas</div><xsl:apply-templates mode="tekst"/></div>
130 <xsl:template match="forma" mode="aktywnosc">
131 <div class="item"><div class="defined">Metoda</div><xsl:apply-templates mode="tekst"/></div>
134 <xsl:template match="pomoce" mode="aktywnosc">
135 <div class="item"><div class="defined">Pomoce</div><xsl:apply-templates mode="tekst"/></div>
138 <xsl:template match="link" mode="tekst">
140 <xsl:attribute name="href">
142 <xsl:when test="@material">
143 <xsl:value-of select="concat('file://', @material)"/>
145 <xsl:when test="@url">
146 <xsl:value-of select="@url"/>
150 <xsl:apply-templates mode="tekst"/>
154 <xsl:template match="wyroznienie" mode="tekst">
156 <xsl:apply-templates mode="tekst"/>
160 <xsl:template match="dlugi_cytat" mode="tekst">
162 <xsl:apply-templates mode="tekst"/>
168 <xsl:template match="cwiczenie" mode="rozdzial">