1 <?xml version="1.0" encoding="utf-8"?>
4 This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5 Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
8 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:wl="http://wolnelektury.pl/functions"
10 xmlns:dc="http://purl.org/dc/elements/1.1/"
11 xmlns="http://www.gribuser.ru/xml/fictionbook/2.0"
12 xmlns:l="http://www.w3.org/1999/xlink">
16 <!-- match poem citations -->
17 <xsl:template mode="paras" match="poezja_cyt">
20 <xsl:apply-templates mode="poem"/>
24 <!-- / XXX: fb2 doesn't allow <poem/> inside <p/> /
25 <xsl:template mode="inline" match="poezja_cyt">
28 <xsl:apply-templates mode="poem"/>
33 <!-- regular poem elements -->
34 <xsl:template mode="poem" match="strofa">
36 <xsl:call-template name="split-poem">
37 <xsl:with-param name="list" select="."/>
42 <!-- split into verses -->
43 <xsl:template name="split-poem">
44 <xsl:param name="list"></xsl:param>
46 <xsl:if test="$list != ''">
47 <xsl:variable name="before"
48 select="substring-before(concat($list, '/'), '/')"/>
49 <xsl:variable name="after"
50 select="substring-after($list, '/')"/>
53 <xsl:value-of select="$before"/>
56 <xsl:call-template name="split-poem">
57 <xsl:with-param name="list" select="$after"/>
62 <xsl:template match="text()" mode="poem"/>