allow multiple dc:publisher
authorJan Szejko <janek37@gmail.com>
Mon, 6 Mar 2017 13:05:02 +0000 (14:05 +0100)
committerJan Szejko <janek37@gmail.com>
Mon, 6 Mar 2017 13:05:31 +0000 (14:05 +0100)
librarian/dcparser.py
librarian/epub/xsltContent.xsl
librarian/fb2/description.xslt

index 31f2dae..40eac14 100644 (file)
@@ -238,7 +238,7 @@ class WorkInfo(object):
 
         Field(DCNS('date'), 'created_at'),
         Field(DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False),
 
         Field(DCNS('date'), 'created_at'),
         Field(DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False),
-        Field(DCNS('publisher'), 'publisher'),
+        Field(DCNS('publisher'), 'publisher', multiple=True),
 
         Field(DCNS('language'), 'language'),
         Field(DCNS('description'), 'description', required=False),
 
         Field(DCNS('language'), 'language'),
         Field(DCNS('description'), 'description', required=False),
index fa033ee..24315c5 100644 (file)
           </xsl:for-each>
         </dc:creator>
         <dc:publisher>
           </xsl:for-each>
         </dc:creator>
         <dc:publisher>
-          <xsl:apply-templates select="//dc:publisher" />
+          <xsl:for-each select="//dc:publisher/text()">
+            <xsl:value-of select="."/>
+            <xsl:if test="not(position() = last())">; </xsl:if>
+          </xsl:for-each>
         </dc:publisher>
         <dc:date opf:event="publication">
           <xsl:apply-templates select="//dc:date" />
         </dc:publisher>
         <dc:date opf:event="publication">
           <xsl:apply-templates select="//dc:date" />
index 312df2d..6d7383f 100644 (file)
                                <version>0</version>
                        </document-info>
                        <publish-info>
                                <version>0</version>
                        </document-info>
                        <publish-info>
-                               <xsl:apply-templates mode="description"
-                                       select="dc:publisher"/>
+                               <publisher>
+                                       <xsl:for-each select="//dc:publisher/text()">
+                                               <xsl:value-of select="."/>
+                                               <xsl:if test="not(position() = last())">; </xsl:if>
+                                       </xsl:for-each>
+                               </publisher>
                        </publish-info>
                </description>
        </xsl:template>
                        </publish-info>
                </description>
        </xsl:template>