c2114485f27c3d5f502f324cb9acc06ff2d19313
[librarian.git] / librarian / epub / xsltContent.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wl="http://wolnelektury.pl/functions">
3   <xsl:output method="html" version="1.0" omit-xml-declaration="no" />
4
5   <xsl:template match="/">
6     <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">
7       <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf">
8         <xsl:apply-templates select="//dc:title" />
9         <dc:language>
10           <xsl:apply-templates select="//dc:language" mode="language" />
11         </dc:language>
12         <dc:identifier id="BookId" opf:scheme="URI">
13           <xsl:apply-templates select="//dc:identifier.url" />
14         </dc:identifier>
15         <dc:subject>
16           <xsl:apply-templates select="//dc:identifier.url" />
17         </dc:subject>
18         <dc:creator opf:role="aut">
19                 <xsl:attribute name="opf:file-as">
20                 <xsl:value-of select="//dc:creator" />
21             </xsl:attribute>
22             <xsl:apply-templates select="//dc:creator" mode="person" />
23         </dc:creator>
24         <dc:publisher>
25           <xsl:apply-templates select="//dc:publisher" />
26         </dc:publisher>
27         <dc:date opf:event="publication">
28           <xsl:apply-templates select="//dc:date" />
29         </dc:date>
30       </metadata>
31       <manifest>
32         <item id="toc" href="toc.ncx" media-type="application/x-dtbncx+xml" />
33         <item id="style" href="style.css" media-type="text/css" />
34         <item id="titlePage" href="title.html" media-type="application/xhtml+xml" />
35         <item id="logo_wolnelektury" href="logo_wolnelektury.png" media-type="image/png" />
36         <item id="jedenprocent" href="jedenprocent.png" media-type="image/png" />
37       </manifest>
38       <spine toc="toc">
39         <itemref idref="titlePage" />
40       </spine>
41       <guide>
42         <reference type="text" title="PoczÄ…tek" href="part1.html" />
43       </guide>
44     </package>
45   </xsl:template>
46
47   <xsl:template match="dc:title" >
48     <dc:title>
49       <xsl:value-of select="." />
50     </dc:title>
51   </xsl:template>
52   
53   <xsl:template match="text()" mode="person">
54     <xsl:value-of select="wl:person_name(.)" />
55   </xsl:template>
56   
57   <xsl:template match="text()" mode="language">
58     <xsl:value-of select="wl:lang_code_3to2(.)" />
59   </xsl:template>
60
61 </xsl:stylesheet>