From: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Date: Mon, 25 Oct 2010 08:48:44 +0000 (+0200)
Subject: fix author name
X-Git-Tag: 1.7~262
X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/3a27423b73ba18f8aad3043c1fbcdbf6e4dad890

fix author name
---

diff --git a/librarian/epub.py b/librarian/epub.py
index 52294dd..e992f40 100644
--- a/librarian/epub.py
+++ b/librarian/epub.py
@@ -20,6 +20,10 @@ sys.path.append('..') # for running from working copy
 from librarian import XMLNamespace, RDFNS, DCNS, WLNS, NCXNS, OPFNS, NoDublinCore
 from librarian.dcparser import BookInfo
 
+from librarian import functions
+
+functions.reg_person_name()
+
 
 def inner_xml(node):
     """ returns node's text and children as a string
diff --git a/librarian/epub/xsltTitle.xsl b/librarian/epub/xsltTitle.xsl
index c69db26..3b24c76 100644
--- a/librarian/epub/xsltTitle.xsl
+++ b/librarian/epub/xsltTitle.xsl
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">
+<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">
   <xsl:output method="html" version="1.0" encoding="utf-8" />
   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
@@ -18,10 +21,12 @@
           <div class='title-page'>
             <xsl:choose>
               <xsl:when test="//autor_utworu | //nazwa_utworu">
-                <xsl:apply-templates select="//autor_utworu | //nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
+                <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+                <xsl:apply-templates select="//nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
               </xsl:when>
               <xsl:otherwise>
-                <xsl:apply-templates select="//dc:creator | //dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
+                <xsl:apply-templates select="//dc:creator" mode="poczatek"/>
+                <xsl:apply-templates select="//dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
               </xsl:otherwise>
             </xsl:choose>
           </div>
@@ -48,6 +53,12 @@
     </div>
   </xsl:template>
 
+  <xsl:template match="dc:creator/text()">
+    <div class="author" xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:value-of select="wl:person_name(.)" />
+    </div>
+  </xsl:template>
+
   <xsl:template match="autor_utworu" mode="poczatek">
     <div class="author" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />