| 1 | <?xml version="1.0"?> |
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 3 | xmlns:d="http://docbook.org/ns/docbook" |
| 4 | xmlns:fo="http://www.w3.org/1999/XSL/Format" |
| 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" |
| 6 | exclude-result-prefixes="dc d" |
| 7 | version='1.0'> |
| 8 | |
| 9 | <xsl:template match="d:drama/d:title"/> |
| 10 | <xsl:template match="d:poetry/d:title"/> |
| 11 | <xsl:template match="d:dialogue/d:title"/> |
| 12 | |
| 13 | <xsl:template match="d:drama"> |
| 14 | <xsl:variable name="id"> |
| 15 | <xsl:call-template name="object.id"/> |
| 16 | </xsl:variable> |
| 17 | |
| 18 | <xsl:element name="fo:{$section.container.element}" |
| 19 | use-attribute-sets="drama.properties"> |
| 20 | <xsl:attribute name="id"><xsl:value-of |
| 21 | select="$id"/></xsl:attribute> |
| 22 | <xsl:call-template name="drama.titlepage"/> |
| 23 | <xsl:apply-templates/> |
| 24 | </xsl:element> |
| 25 | </xsl:template> |
| 26 | |
| 27 | <xsl:template match="d:dialogue"> |
| 28 | <xsl:variable name="id"> |
| 29 | <xsl:call-template name="object.id"/> |
| 30 | </xsl:variable> |
| 31 | |
| 32 | <xsl:element name="fo:{$section.container.element}" |
| 33 | use-attribute-sets="dialogue.properties"> |
| 34 | <xsl:attribute name="id"><xsl:value-of |
| 35 | select="$id"/></xsl:attribute> |
| 36 | <xsl:call-template name="dialogue.titlepage"/> |
| 37 | <xsl:apply-templates/> |
| 38 | </xsl:element> |
| 39 | </xsl:template> |
| 40 | |
| 41 | <xsl:template match="d:poetry"> |
| 42 | <xsl:variable name="id"> |
| 43 | <xsl:call-template name="object.id"/> |
| 44 | </xsl:variable> |
| 45 | |
| 46 | <xsl:element name="fo:{$section.container.element}" |
| 47 | use-attribute-sets="poetry.properties"> |
| 48 | <xsl:attribute name="id"><xsl:value-of |
| 49 | select="$id"/></xsl:attribute> |
| 50 | <xsl:call-template name="poetry.titlepage"/> |
| 51 | <xsl:apply-templates/> |
| 52 | </xsl:element> |
| 53 | </xsl:template> |
| 54 | |
| 55 | <xsl:template match="d:stagedir"> |
| 56 | <xsl:variable name="id"> |
| 57 | <xsl:call-template name="object.id"/> |
| 58 | </xsl:variable> |
| 59 | |
| 60 | <xsl:variable name="keep.together"> |
| 61 | <xsl:call-template name="pi.dbfo_keep-together"/> |
| 62 | </xsl:variable> |
| 63 | |
| 64 | <fo:block id="{$id}" xsl:use-attribute-sets="stagedir.properties"> |
| 65 | <xsl:if test="$keep.together != ''"> |
| 66 | <xsl:attribute name="keep-together.within-column"><xsl:value-of |
| 67 | select="$keep.together"/></xsl:attribute> |
| 68 | </xsl:if> |
| 69 | <xsl:apply-templates /> |
| 70 | </fo:block> |
| 71 | |
| 72 | </xsl:template> |
| 73 | |
| 74 | <xsl:template match="d:inlinestagedir"> |
| 75 | <fo:inline xsl:use-attribute-sets="inlinestagedir.properties"> |
| 76 | <xsl:call-template name="anchor"/> |
| 77 | <xsl:text> [</xsl:text> |
| 78 | <xsl:apply-templates /> |
| 79 | <xsl:text>] </xsl:text> |
| 80 | </fo:inline> |
| 81 | </xsl:template> |
| 82 | |
| 83 | <xsl:template match="d:linegroup"> |
| 84 | <xsl:variable name="id"> |
| 85 | <xsl:call-template name="object.id"/> |
| 86 | </xsl:variable> |
| 87 | |
| 88 | <xsl:variable name="keep.together"> |
| 89 | <xsl:call-template name="pi.dbfo_keep-together"/> |
| 90 | </xsl:variable> |
| 91 | |
| 92 | <fo:list-block id="{$id}" xsl:use-attribute-sets="linegroup.properties"> |
| 93 | <xsl:if test="$keep.together != ''"> |
| 94 | <xsl:attribute name="keep-together.within-column"><xsl:value-of |
| 95 | select="$keep.together"/></xsl:attribute> |
| 96 | </xsl:if> |
| 97 | <fo:list-item> |
| 98 | <fo:list-item-label end-indent="label-end()"> |
| 99 | <xsl:apply-templates select="d:speaker"/> |
| 100 | </fo:list-item-label> |
| 101 | <fo:list-item-body start-indent="body-start()"> |
| 102 | <xsl:apply-templates select="*[not(self::d:speaker)]"/> |
| 103 | </fo:list-item-body> |
| 104 | </fo:list-item> |
| 105 | </fo:list-block> |
| 106 | </xsl:template> |
| 107 | |
| 108 | <xsl:template match="d:speaker"> |
| 109 | <fo:block xsl:use-attribute-sets="speaker.properties"> |
| 110 | <xsl:call-template name="anchor"/> |
| 111 | <xsl:apply-templates/> |
| 112 | </fo:block> |
| 113 | </xsl:template> |
| 114 | |
| 115 | <xsl:template match="d:line"> |
| 116 | <fo:block xsl:use-attribute-sets="line.properties"> |
| 117 | <xsl:call-template name="anchor"/> |
| 118 | <xsl:apply-templates/> |
| 119 | </fo:block> |
| 120 | </xsl:template> |
| 121 | |
| 122 | </xsl:stylesheet> |