|
From: <sh...@us...> - 2007-08-08 14:34:42
|
Revision: 46
http://fb2-perl-tools.svn.sourceforge.net/fb2-perl-tools/?rev=46&view=rev
Author: shaplov
Date: 2007-08-08 07:34:35 -0700 (Wed, 08 Aug 2007)
Log Message:
-----------
An XSLT transformation fb2_to_docbook by KiR Jakobson
Someone should later write perl warp...
Added Paths:
-----------
trunk/fb2-perl-tools/xslt/
trunk/fb2-perl-tools/xslt/fb2docbook.xsl
trunk/fb2-perl-tools/xslt/fb2docbook_gen_infos.xsl
trunk/fb2-perl-tools/xslt/l10n/
trunk/fb2-perl-tools/xslt/l10n/en.xml
trunk/fb2-perl-tools/xslt/l10n/gentext.xsl
trunk/fb2-perl-tools/xslt/l10n/l10n.dtd
trunk/fb2-perl-tools/xslt/l10n/l10n.xml
trunk/fb2-perl-tools/xslt/l10n/ru.xml
trunk/fb2-perl-tools/xslt/params/
trunk/fb2-perl-tools/xslt/params/system_params.xsl
Added: trunk/fb2-perl-tools/xslt/fb2docbook.xsl
===================================================================
--- trunk/fb2-perl-tools/xslt/fb2docbook.xsl (rev 0)
+++ trunk/fb2-perl-tools/xslt/fb2docbook.xsl 2007-08-08 14:34:35 UTC (rev 46)
@@ -0,0 +1,800 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fb="http://www.gribuser.ru/xml/fictionbook/2.0"
+ xmlns:exsl="http://exslt.org/common" xmlns:redirect="http://xml.apache.org/xalan/redirect"
+ extension-element-prefixes="exsl redirect" exclude-result-prefixes="fb exsl redirect xlink"
+ version="1.1">
+ <xsl:import href="params/system_params.xsl"/>
+ <xsl:import href="l10n/gentext.xsl"/>
+ <xsl:import href="fb2docbook_gen_infos.xsl"/>
+ <xsl:param name="conv_info_idx"/>
+ <xsl:param name="document-element"/>
+ <xsl:output encoding="UTF-8" indent="yes" method="xml"
+ doctype-system="http://www.docbook.org/xml/4.4/docbookx.dtd"
+ doctype-public="-//OASIS//DTD DocBook XML V4.4//EN"/>
+ <xsl:key name="note-link" match="fb:section" use="@id"/>
+ <xsl:key name="binary-link" match="fb:binary" use="@id"/>
+ <xsl:template name="gen_binary_asciiname">
+ <xsl:param name="bin_href"/>
+ <xsl:value-of select="concat($bin_href, '.base64')"/>
+ </xsl:template>
+ <xsl:template name="gen_fname">
+ <xsl:param name="href"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($href,'#')">
+ <xsl:value-of select="substring-after($href,'#')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$href"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get_docbook_format">
+ <xsl:param name="content-type"/>
+ <xsl:value-of
+ select="exsl:node-set($fb2.mime-types)/mime-type[@id=$content-type]/@docbook-format"/>
+ </xsl:template>
+ <xsl:template name="get_part_name">
+ <xsl:param name="level"/>
+ <xsl:variable name="num_levels" select="count(exsl:node-set($fb2.book-parts)/part)"/>
+ <xsl:choose>
+ <xsl:when test="$level > 0 and $level < $num_levels">
+ <xsl:value-of
+ select="exsl:node-set($fb2.book-parts)/part[@level=string($level)]/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="exsl:node-set($fb2.book-parts)/part[last()]/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get_part_intro_name">
+ <xsl:param name="level"/>
+ <xsl:variable name="num_levels" select="count(exsl:node-set($fb2.book-parts)/part)"/>
+ <xsl:choose>
+ <xsl:when test="$level > 0 and $level < $num_levels">
+ <xsl:value-of
+ select="exsl:node-set($fb2.book-parts)/part[@level=string($level)]/@intro-name"
+ />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="exsl:node-set($fb2.book-parts)/part[last()]/@intro-name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:FictionBook">
+ <xsl:variable name="blang">
+ <xsl:choose>
+ <xsl:when test="fb:description/fb:title-info/fb:lang/text() != ''">
+ <xsl:value-of select="fb:description/fb:title-info/fb:lang/text()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$fb2.default.language"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <book xml:lang="{$blang}">
+ <xsl:for-each select="fb:description">
+ <xsl:call-template name="bookinfo"/>
+ </xsl:for-each>
+ <xsl:apply-templates select="fb:body[not (@name = 'notes' or @name = 'footnotes')]"/>
+
+ <xsl:if test="$fb2.print.infos">
+ <xsl:call-template name="title-info-appendix"/>
+ <xsl:call-template name="src-title-info-appendix"/>
+ <xsl:call-template name="document-info-appendix"/>
+ <xsl:call-template name="publish-info-appendix"/>
+ <xsl:call-template name="custom-info-appendix"/>
+ <xsl:call-template name="technical-appendix"/>
+ </xsl:if>
+
+ <xsl:call-template name="binaries_index">
+ <xsl:with-param name="idx_fname">
+ <xsl:value-of select="$conv_info_idx"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:apply-templates select="fb:binary"/>
+ <!--xsl:apply-templates select="fb:body[(@name = 'notes')]"/-->
+ </book>
+ </xsl:template>
+ <xsl:template name="bookinfo">
+ <bookinfo>
+ <xsl:if test="count(fb:title-info/fb:coverpage|fb:title-info/fb:annotation)">
+ <abstract id="preface_annotation" xml:lang="{fb:title-info/fb:lang/text()}">
+ <para>
+ <xsl:apply-templates select="fb:title-info/fb:coverpage/fb:image"/>
+ </para>
+ <xsl:for-each select="fb:title-info/fb:annotation/*">
+ <xsl:choose>
+ <xsl:when
+ test="local-name(.) = 'cite' or local-name(.) = 'empty-line' or local-name(.) = 'table'">
+ <para>
+ <xsl:apply-templates select="."/>
+ </para>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </abstract>
+ </xsl:if>
+ <xsl:if test="count(fb:src-title-info/fb:coverpage|fb:src-title-info/fb:annotation)">
+ <abstract id="preface_annotation_original"
+ xml:lang="{fb:src-title-info/fb:lang/text()}">
+ <para>
+ <xsl:apply-templates select="fb:src-title-info/fb:coverpage/fb:image"/>
+ </para>
+ <xsl:for-each select="fb:src-title-info/fb:annotation/*">
+ <xsl:choose>
+ <xsl:when
+ test="local-name(.) = 'cite' or local-name(.) = 'empty-line' or local-name(.) = 'table'">
+ <para>
+ <xsl:apply-templates select="."/>
+ </para>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <!--xsl:apply-templates select="fb:src-title-info/fb:annotation/*"/-->
+ </abstract>
+ </xsl:if>
+ <title>
+ <xsl:value-of select="fb:title-info/fb:book-title"/>
+ </title>
+ <xsl:choose>
+ <xsl:when test="count(fb:title-info/fb:author) > 1">
+ <authorgroup>
+ <xsl:apply-templates select="fb:title-info/fb:author" mode="bookinfo"/>
+ </authorgroup>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="fb:title-info/fb:author" mode="bookinfo"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="fb:title-info/fb:translator" mode="bookinfo"/>
+ <xsl:call-template name="bookinfo-sequence"/>
+ <xsl:call-template name="bookinfo-date"/>
+ <xsl:call-template name="bookinfo-publish"/>
+ </bookinfo>
+ </xsl:template>
+ <xsl:template name="bookinfo-publish">
+ <xsl:if test="count(fb:publish-info/fb:publisher)">
+ <publishername>
+ <xsl:value-of select="fb:publish-info/fb:publisher/text()"/>
+ </publishername>
+ </xsl:if>
+ <xsl:if test="count(fb:publish-info/fb:isbn)">
+ <bibliosource class="isbn">
+ <xsl:value-of select="fb:publish-info/fb:isbn/text()"/>
+ </bibliosource>
+ </xsl:if>
+ <xsl:if test="count(fb:publish-info/fb:year)">
+ <pubdate>
+ <xsl:value-of select="fb:publish-info/fb:year/text()"/>
+ </pubdate>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="bookinfo-date">
+ <date>
+ <xsl:choose>
+ <xsl:when test="fb:title-info/fb:date/text() = ''">
+ <xsl:value-of select="fb:title-info/fb:date/@value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="fb:title-info/fb:date/text()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </date>
+ </xsl:template>
+ <xsl:template name="bookinfo-sequence">
+ <xsl:if test="count(fb:title-info/fb:sequence)">
+ <seriesvolnums>
+ <xsl:value-of select="fb:title-info/fb:sequence/@name"/>
+ </seriesvolnums>
+ <volumenum>
+ <xsl:value-of select="fb:title-info/fb:sequence/@number"/>
+ </volumenum>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="fb:body">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:if test="count(fb:image) or count(fb:epigraph)">
+ <preface id="{concat('preface_preface', generate-id())}">
+ <title id="{concat('prefacetitle', generate-id())}">
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'Preface'"/>
+ </xsl:call-template>
+ </title>
+ <xsl:apply-templates select="fb:image"/>
+ <xsl:apply-templates select="fb:epigraph"/>
+ </preface>
+ </xsl:if>
+ <xsl:for-each select="fb:section">
+ <xsl:call-template name="fb-section">
+ <xsl:with-param name="level" select="1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="fb-section">
+ <xsl:param name="level"/>
+ <xsl:variable name="part-name">
+ <xsl:call-template name="get_part_name">
+ <xsl:with-param name="level" select="$level"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="part-intro-name">
+ <xsl:call-template name="get_part_intro_name">
+ <xsl:with-param name="level" select="$level"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="{$part-name}">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:call-template name="section_title"/>
+ <xsl:choose>
+ <!-- если нет section в part, не загонять все в partintro; пустой partintro !!! -->
+ <xsl:when test="$part-intro-name != ''">
+ <xsl:element name="{$part-intro-name}">
+ <xsl:apply-templates
+ select="*[local-name(.) != 'section' and local-name(.) != 'title']"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates
+ select="*[local-name(.) != 'section' and local-name(.) != 'title']"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:for-each select="fb:section">
+ <xsl:call-template name="fb-section">
+ <xsl:with-param name="level" select="$level + 1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="section_title">
+ <xsl:param name="role" select="''"/>
+ <title>
+ <xsl:if test="$role != ''">
+ <xsl:attribute name="role">
+ <xsl:value-of select="$role"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="fb:title/fb:p">
+ <xsl:apply-templates/>
+ <xsl:text xml:space="preserve"> </xsl:text>
+ </xsl:for-each>
+ </title>
+ </xsl:template>
+ <xsl:template match="fb:p">
+ <para>
+ <xsl:if test="local-name(..) = 'section'">
+ <xsl:attribute name="role">p</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:apply-templates/>
+ </para>
+ </xsl:template>
+ <xsl:template match="fb:p" mode="epigraph">
+ <para role="epigraph">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:apply-templates/>
+ </para>
+ </xsl:template>
+ <!--xsl:template match="fb:epigraph">
+ <xsl:element name="epigraph">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:if test="count(fb:text-author) != 0">
+ <attribution>
+ <xsl:apply-templates select="fb:text-author"/>
+ </attribution>
+ </xsl:if>
+ <xsl:apply-templates select="fb:p|fb:poem|fb:cite|fb:empty-line" mode="epigraph"/>
+ </xsl:element>
+ </xsl:template-->
+ <xsl:template match="fb:epigraph">
+ <xsl:element name="blockquote">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:if test="count(fb:text-author) != 0">
+ <attribution>
+ <xsl:apply-templates select="fb:text-author"/>
+ </attribution>
+ </xsl:if>
+ <xsl:apply-templates select="*[local-name(.) != 'text-author']"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="fb:empty-line" name="empty-line">
+ <literallayout/>
+ </xsl:template>
+ <xsl:template match="fb:empty-line" mode="epigraph">
+ <xsl:call-template name="empty-line"/>
+ </xsl:template>
+ <xsl:template match="fb:a">
+ <xsl:variable name="href_id">
+ <xsl:call-template name="gen_fname">
+ <xsl:with-param name="href" select="@xlink:href"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="@type = 'note'">
+ <xsl:call-template name="a_footnote">
+ <xsl:with-param name="href_id" select="$href_id"/>
+ <xsl:with-param name="label" select="text()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($href_id,'#')">
+ <xsl:call-template name="a_xref">
+ <xsl:with-param name="href_id" select="$href_id"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="a_ulink">
+ <xsl:with-param name="href_id" select="$href_id"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="a_footnote">
+ <xsl:param name="href_id"/>
+ <xsl:param name="label"/>
+ <xsl:element name="footnote">
+ <xsl:attribute name="id">
+ <xsl:value-of select="$href_id"/>
+ </xsl:attribute>
+ <xsl:for-each select="key('note-link', $href_id)">
+ <!-- == work for XEP, in FOP only work labels without spaces == -->
+ <!--xsl:attribute name="label">
+ <xsl:choose>
+ <xsl:when test="$label = ''">
+ <xsl:value-of select="fb:title/fb:p/text()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$label"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute-->
+ <xsl:apply-templates select="fb:p"/>
+ </xsl:for-each>
+ <xsl:if test="count(key('note-link', $href_id)) = 0">
+ <xsl:message> Footnote body not found <xsl:value-of select="$href_id"/>!</xsl:message>
+ <para>
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'error.bad.note'"/>
+ </xsl:call-template>
+ <xsl:value-of select="$href_id"/>
+ <xsl:text>!</xsl:text>
+ </para>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="a_ulink">
+ <xsl:param name="href_id"/>
+ <ulink url="{$href_id}">
+ <xsl:if test="@xlink:type != ''">
+ <xsl:attribute name="xlink:type">
+ <xsl:value-of select="@xlink:type"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </ulink>
+ </xsl:template>
+ <xsl:template name="a_xref">
+ <xsl:param name="href_id"/>
+ <xref linkend="{$href_id}"/>
+ </xsl:template>
+ <xsl:template name="metadata_author">
+ <xsl:choose>
+ <xsl:when test="count(fb:nickname) and count(fb:first-name) = 0">
+ <xsl:value-of select="fb:nickname"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="fb:first-name"/>
+ <xsl:if test="count(fb:middle-name)">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="fb:middle-name"/>
+ </xsl:if>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="fb:last-name"/>
+ <xsl:if test="count(fb:nickname)">
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="fb:nickname"/>
+ <xsl:text>"</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="write_binaries_tree">
+ <conversion_info>
+ <page>
+ <dpi>
+ <width><xsl:value-of select="$output.dpi.width"/></width>
+ <height><xsl:value-of select="$output.dpi.height"/></height>
+ </dpi>
+ <size>
+ <width><xsl:value-of select="$page.width"/></width>
+ <height><xsl:value-of select="$page.height"/></height>
+ </size>
+ <max_image_margin>
+ <width><xsl:value-of select="$output.max_image_margin.width"/></width>
+ <height><xsl:value-of select="$output.max_image_margin.height"/></height>
+ </max_image_margin>
+ <images_mode>
+ <resize><xsl:value-of select="$output.images_mode.resize"/></resize>
+ <mode><xsl:value-of select="$output.images_mode.mode"/></mode>
+ </images_mode>
+ </page>
+ <metadata>
+ <Title>
+ <xsl:value-of select="/fb:FictionBook/fb:description/fb:title-info/fb:book-title"/>
+ </Title>
+ <Author>
+ <xsl:for-each select="/fb:FictionBook/fb:description/fb:title-info/fb:author[position() = 1]">
+ <xsl:call-template name="metadata_author"/>
+ </xsl:for-each>
+ <xsl:for-each select="/fb:FictionBook/fb:description/fb:title-info/fb:author[position() > 1]">
+ <xsl:text>; </xsl:text>
+ <xsl:call-template name="metadata_author"/>
+ </xsl:for-each>
+ </Author>
+ </metadata>
+ <binaries>
+ <xsl:for-each select="fb:binary">
+ <xsl:variable name="bin_ascii_name">
+ <xsl:call-template name="gen_binary_asciiname">
+ <xsl:with-param name="bin_href" select="@id"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <binary href_binary="{@id}" href_ascii="{$bin_ascii_name}"
+ content-type="{@content-type}"/>
+ </xsl:for-each>
+ </binaries>
+ </conversion_info>
+ </xsl:template>
+ <xsl:template name="binaries_index">
+ <xsl:param name="idx_fname"/>
+ <xsl:choose>
+ <xsl:when test="$document-element = 'exsl:document'">
+ <exsl:document href="{$idx_fname}" method="xml" encoding="UTF-8">
+ <xsl:call-template name="write_binaries_tree"/>
+ </exsl:document>
+ </xsl:when>
+ <xsl:when test="$document-element = 'xsl:document'">
+ <xsl:document href="{$idx_fname}" method="xml" encoding="UTF-8">
+ <xsl:call-template name="write_binaries_tree"/>
+ </xsl:document>
+ </xsl:when>
+ <xsl:when test="$document-element = 'redirect:write'">
+ <redirect:write file="{$idx_fname}">
+ <xsl:call-template name="write_binaries_tree"/>
+ </redirect:write>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message> Unknown xsl:document element!!! </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:binary">
+ <xsl:variable name="bin_ascii_name">
+ <xsl:call-template name="gen_binary_asciiname">
+ <xsl:with-param name="bin_href" select="@id"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$document-element = 'exsl:document'">
+ <exsl:document href="{$bin_ascii_name}" method="text" indent="no">
+ <xsl:value-of select="text()"/>
+ </exsl:document>
+ </xsl:when>
+ <xsl:when test="$document-element = 'xsl:document'">
+ <xsl:document href="{$bin_ascii_name}" method="text" indent="no">
+ <xsl:value-of select="text()"/>
+ </xsl:document>
+ </xsl:when>
+ <xsl:when test="$document-element = 'redirect:write'">
+ <redirect:write file="{$bin_ascii_name}">
+ <xsl:value-of select="text()"/>
+ </redirect:write>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message> Unknown xsl:document element!!! </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:image">
+ <xsl:variable name="href_id">
+ <xsl:call-template name="gen_fname">
+ <xsl:with-param name="href" select="@xlink:href"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="content-type" select="key('binary-link', $href_id)/@content-type"/>
+ <xsl:variable name="docbook-format">
+ <xsl:call-template name="get_docbook_format">
+ <xsl:with-param name="content-type" select="$content-type"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="media_element">
+ <xsl:choose>
+ <xsl:when
+ test="local-name(..) = 'section' or local-name(..) = 'body' or local-name(..) = 'coverpage'"
+ >mediaobject</xsl:when>
+ <xsl:otherwise>inlinemediaobject</xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:variable>
+ <xsl:element name="{$media_element}">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <imageobject>
+ <imagedata align="{$fb2.image.align}" valign="{$fb2.image.valign}"
+ fileref="{$href_id}" format="{$docbook-format}"/>
+ </imageobject>
+ <xsl:if test="@alt != ''">
+ <textobject>
+ <xsl:value-of select="@alt"/>
+ </textobject>
+ </xsl:if>
+ <xsl:if test="@title != ''">
+ <caption>
+ <para>
+ <xsl:value-of select="@title"/>
+ </para>
+ </caption>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="fb:emphasis">
+ <emphasis>
+ <xsl:apply-templates/>
+ </emphasis>
+ </xsl:template>
+ <xsl:template match="fb:strong">
+ <emphasis role="strong">
+ <xsl:apply-templates/>
+ </emphasis>
+ </xsl:template>
+ <xsl:template match="fb:strikethrough">
+ <emphasis role="strikethrough">
+ <xsl:apply-templates/>
+ </emphasis>
+ </xsl:template>
+ <xsl:template match="fb:sub">
+ <subscript>
+ <xsl:apply-templates/>
+ </subscript>
+ </xsl:template>
+ <xsl:template match="fb:sup">
+ <superscript>
+ <xsl:apply-templates/>
+ </superscript>
+ </xsl:template>
+ <xsl:template match="fb:code">
+ <code>
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:apply-templates/>
+ </code>
+ </xsl:template>
+ <xsl:template match="fb:cite" name="cite">
+ <blockquote>
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:if test="count(fb:text-author) != 0">
+ <attribution>
+ <xsl:apply-templates select="fb:text-author"/>
+ </attribution>
+ </xsl:if>
+ <xsl:apply-templates select="*[local-name(.) != 'text-author']"/>
+ </blockquote>
+ </xsl:template>
+ <xsl:template match="fb:cite" mode="epigraph">
+ <xsl:call-template name="cite"/>
+ </xsl:template>
+ <xsl:template match="fb:text-author">
+ <author>
+ <personname>
+ <othername>
+ <xsl:value-of select="text()"/>
+ </othername>
+ </personname>
+ </author>
+ </xsl:template>
+ <xsl:template match="fb:poem" mode="epigraph">
+ <xsl:call-template name="poem"/>
+ </xsl:template>
+ <xsl:template match="fb:poem" name="poem">
+ <xsl:choose>
+ <xsl:when test="count(fb:title) > 0">
+ <formalpara role="poem">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:call-template name="section_title">
+ <xsl:with-param name="role" select="'poem'"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="fb:epigraph"/>
+ <para role="poem">
+ <xsl:apply-templates select="fb:stanza"/>
+ <xsl:apply-templates select="fb:text-author"/>
+ <xsl:apply-templates select="fb:date"/>
+ </para>
+ </formalpara>
+ </xsl:when>
+ <xsl:otherwise>
+ <para role="poem">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <xsl:apply-templates select="fb:epigraph"/>
+ <xsl:apply-templates select="fb:stanza"/>
+ <xsl:apply-templates select="fb:text-author"/>
+ <xsl:apply-templates select="fb:date"/>
+ </para>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:stanza">
+ <xsl:choose>
+ <xsl:when test="count(fb:title) > 0">
+ <formalpara role="poem">
+ <xsl:call-template name="section_title"/>
+ <para role="poem">
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <literallayout xml:space="preserve" role="poem">
+ <xsl:apply-templates select="fb:v"/>
+ </literallayout>
+ </para>
+ </formalpara>
+ </xsl:when>
+ <xsl:otherwise>
+ <literallayout xml:space="preserve" role="poem"><xsl:apply-templates select="@xml:lang|@id"/><xsl:apply-templates select="fb:v"/></literallayout>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:v">
+ <xsl:choose>
+ <xsl:when test="local-name(..) = 'stanza'">
+ <xsl:apply-templates/>
+ <xsl:text xml:space="preserve">
</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>
+ <xsl:text>Bad parent of tag v (must be stanza)!!!</xsl:text>
+ </xsl:message>
+ <simpara>
+ <literal>
+ <xsl:apply-templates/>
+ <xsl:text xml:space="preserve">
</xsl:text>
+ </literal>
+ </simpara>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="fb:table">
+ <informaltable>
+ <xsl:apply-templates/>
+ </informaltable>
+ </xsl:template>
+ <xsl:template match="fb:tr|fb:th|fb:td">
+ <xsl:element name="{local-name(.)}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="fb:subtitle">
+ <simpara>
+ <xsl:apply-templates select="@xml:lang|@id"/>
+ <emphasis role="{$fb2.subtitle.role}">
+ <xsl:apply-templates/>
+ </emphasis>
+ </simpara>
+ <xsl:processing-instruction name="dbfo">
+ <xsl:text>keep-together="always"</xsl:text>
+ </xsl:processing-instruction>
+ </xsl:template>
+ <xsl:template match="fb:style">
+ <xsl:comment> == style <xsl:value-of select="@name"/> == </xsl:comment>
+ <xsl:choose>
+ <xsl:when test="@xml:lang != ''">
+ <foreignphrase>
+ <xsl:apply-templates select="@xml:lang"/>
+ <xsl:apply-templates/>
+ </foreignphrase>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:comment> == style_end <xsl:value-of select="@name"/> == </xsl:comment>
+ </xsl:template>
+ <xsl:template name="bookinfo-person">
+ <xsl:param name="person-element"/>
+ <xsl:param name="person-class"/>
+ <xsl:element name="{$person-element}">
+ <xsl:if test="$person-class != ''">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$person-class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates
+ select="*[local-name(.) != 'id' and local-name(.) != 'nickname' and local-name(.) != 'home-page' and local-name(.) != 'email']"
+ mode="description"/>
+ <xsl:if test="count(fb:first-name) = 0 and count(fb:last-name) = 0">
+ <xsl:comment> == Bad author, only nickname! == </xsl:comment>
+ <surname>
+ <xsl:value-of select="fb:nickname/text()"/>
+ </surname>
+ </xsl:if>
+ <xsl:call-template name="authorblurb"/>
+ <xsl:apply-templates select="fb:email" mode="description"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="fb:author" mode="bookinfo">
+ <xsl:call-template name="bookinfo-person">
+ <xsl:with-param name="person-element">author</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="fb:translator" mode="bookinfo">
+ <xsl:call-template name="bookinfo-person">
+ <xsl:with-param name="person-element">othercredit</xsl:with-param>
+ <xsl:with-param name="person-class">translator</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="fb:first-name" mode="description">
+ <firstname>
+ <xsl:value-of select="text()"/>
+ </firstname>
+ </xsl:template>
+ <xsl:template match="fb:last-name" mode="description">
+ <surname>
+ <xsl:value-of select="text()"/>
+ </surname>
+ </xsl:template>
+ <xsl:template match="fb:middle-name" mode="description">
+ <lineage>
+ <xsl:value-of select="text()"/>
+ </lineage>
+ </xsl:template>
+ <xsl:template match="fb:email" mode="description">
+ <email>
+ <xsl:value-of select="text()"/>
+ </email>
+ </xsl:template>
+ <xsl:template name="authorblurb">
+ <xsl:if test="count(fb:nickname) or count(fb:home-page)">
+ <authorblurb>
+ <para>
+ <itemizedlist spacing="compact">
+ <xsl:apply-templates select="fb:nickname|fb:home-page" mode="authorblurb"/>
+ </itemizedlist>
+ </para>
+ </authorblurb>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="fb:nickname" mode="authorblurb">
+ <listitem>
+ <simpara>
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'Nickname'"/>
+ </xsl:call-template>
+ <xsl:text>: </xsl:text>
+ <xsl:value-of select="text()"/>
+ </simpara>
+ </listitem>
+ </xsl:template>
+ <xsl:template match="fb:home-page" mode="authorblurb">
+ <listitem>
+ <simpara>
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'Сайт'"/>
+ </xsl:call-template>
+ <xsl:text>: </xsl:text>
+ <ulink url="{text()}">
+ <xsl:value-of select="text()"/>
+ </ulink>
+ </simpara>
+ </listitem>
+ </xsl:template>
+
+ <xsl:template match="@id">
+ <xsl:copy/>
+ </xsl:template>
+ <xsl:template match="@xml:lang">
+ <xsl:copy/>
+ </xsl:template>
+ <xsl:template match="@*">
+ <xsl:copy/>
+ </xsl:template>
+</xsl:stylesheet>
Added: trunk/fb2-perl-tools/xslt/fb2docbook_gen_infos.xsl
===================================================================
--- trunk/fb2-perl-tools/xslt/fb2docbook_gen_infos.xsl (rev 0)
+++ trunk/fb2-perl-tools/xslt/fb2docbook_gen_infos.xsl 2007-08-08 14:34:35 UTC (rev 46)
@@ -0,0 +1,586 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fb="http://www.gribuser.ru/xml/fictionbook/2.0"
+ xmlns:exsl="http://exslt.org/common" xmlns:redirect="http://xml.apache.org/xalan/redirect"
+ extension-element-prefixes="exsl redirect" version="1.1">
+ <xsl:import href="l10n/gentext.xsl"/>
+ <xsl:template name="technical-appendix">
+ <appendix id="{concat('tappendix', generate-id())}">
+ <title id="{concat('tappendix_title', generate-id())}">
+ <xsl:call-template name="gentext.info.title">
+ <xsl:with-param name="context" select="'technical-appendix'"/>
+ </xsl:call-template>
+ </title>
+ <para>
+ <xsl:call-template name="gentext.info.param">
+ <xsl:with-param name="context" select="'technical-appendix'"/>
+ <xsl:with-param name="param" select="'xslt.processor'"/>
+ </xsl:call-template>
+ <xsl:text>: </xsl:text>
+ <ulink url="{system-property('xsl:vendor-url')}">
+ <xsl:value-of select="system-property('xsl:vendor')"/>
+ </ulink> (XSLT version <xsl:value-of select="system-property('xsl:version')"/>).
+ </para>
+ </appendix>
+ </xsl:template>
+ <xsl:template name="title-info-appendix">
+ <xsl:if test="count(fb:description/fb:title-info)">
+ <xsl:for-each select="fb:description/fb:title-info">
+ <xsl:call-template name="title-info-appendix-wrk">
+ <xsl:with-param name="my_id"
+ select="concat('title-info-appendix', generate-id())"/>
+ <xsl:with-param name="my_title">
+ <xsl:call-template name="gentext.info.title"/>
+ </xsl:with-param>
+ <xsl:with-param name="my_annotation_id" select="'preface_annotation'"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="src-title-info-appendix">
+ <xsl:if test="count(fb:description/fb:src-title-info)">
+ <xsl:for-each select="fb:description/fb:src-title-info">
+ <xsl:call-template name="title-info-appendix-wrk">
+ <xsl:with-param name="my_id"
+ select="concat('src-title-info-appendix', generate-id())"/>
+ <xsl:with-param name="my_title">
+ <xsl:call-template name="gentext.info.title"/>
+ </xsl:with-param>
+ <xsl:with-param name="my_annotation_id" select="'preface_annotation_original'"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="entry-tbl-title">
+ <entry align="left">
+ <simpara>
+ <emphasis role="strong">
+ <xsl:call-template name="gentext.info.param"/>
+ </emphasis>
+ </simpara>
+ </entry>
+ </xsl:template>
+ <xsl:template name="title-info-appendix-wrk">
+ <xsl:param name="my_id"/>
+ <xsl:param name="my_title"/>
+ <xsl:param name="my_annotation_id"/>
+ <appendix id="{$my_id}">
+ <title>
+ <xsl:value-of select="$my_title"/>
+ </title>
+ <informaltable align="center" frame="topbot" colsep="0" rowsep="1">
+ <tgroup cols="2">
+ <colspec colnum="1" colname="col1" colwidth="1*"/>
+ <colspec colnum="2" colname="col2" colwidth="2*"/>
+ <tbody>
+ <xsl:if test="count(fb:genre)">
+ <row>
+ <xsl:for-each select="fb:genre[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-genres"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:author)">
+ <row>
+ <xsl:for-each select="fb:author[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-authors"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:book-title)">
+ <row>
+ <xsl:for-each select="fb:book-title[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:book-title/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:annotation)">
+ <row>
+ <xsl:for-each select="fb:annotation[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-annotation">
+ <xsl:with-param name="my_annotation_id"
+ select="$my_annotation_id"/>
+ </xsl:call-template>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:keywords)">
+ <row>
+ <xsl:for-each select="fb:keywords[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-keywords"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:date)">
+ <row>
+ <xsl:for-each select="fb:date[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-date"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:coverpage)">
+ <row>
+ <xsl:for-each select="fb:coverpage[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-coverpage">
+ <xsl:with-param name="my_annotation_id"
+ select="$my_annotation_id"/>
+ </xsl:call-template>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:lang)">
+ <row>
+ <xsl:for-each select="fb:lang[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-lang"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:src-lang)">
+ <row>
+ <xsl:for-each select="fb:src-lang[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-src-lang"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:translator)">
+ <row>
+ <xsl:for-each select="fb:translator[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-translators"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:sequence)">
+ <row>
+ <xsl:for-each select="fb:sequence[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-sequence"/>
+ </entry>
+ </row>
+ </xsl:if>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </appendix>
+ </xsl:template>
+ <xsl:template name="title-info-genres">
+ <xsl:choose>
+ <xsl:when test="count(fb:genre) > 1">
+ <itemizedlist spacing="compact">
+ <xsl:for-each select="fb:genre">
+ <listitem>
+ <simpara>
+ <xsl:value-of select="text()"/>
+ <xsl:if test="@match != ''"> (<xsl:value-of select="@match"
+ />%)</xsl:if>
+ </simpara>
+ </listitem>
+ </xsl:for-each>
+ </itemizedlist>
+ </xsl:when>
+ <xsl:otherwise>
+ <simpara>
+ <xsl:for-each select="fb:genre">
+ <xsl:value-of select="text()"/>
+ <xsl:if test="@match != ''"> (<xsl:value-of select="@match"/>%)</xsl:if>
+ </xsl:for-each>
+ </simpara>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="title-info-authors">
+ <xsl:choose>
+ <xsl:when test="count(fb:author) > 1">
+ <itemizedlist spacing="compact">
+ <xsl:for-each select="fb:author">
+ <listitem>
+ <simpara>
+ <xsl:apply-templates mode="bookinfo"/>
+ </simpara>
+ </listitem>
+ </xsl:for-each>
+ </itemizedlist>
+ </xsl:when>
+ <xsl:otherwise>
+ <simpara>
+ <xsl:for-each select="fb:author">
+ <xsl:apply-templates mode="bookinfo"/>
+ </xsl:for-each>
+ </simpara>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+ <xsl:template name="title-info-annotation">
+ <xsl:param name="my_annotation_id"/>
+ <simpara>
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'SeeAbr'"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xref linkend="{$my_annotation_id}"/>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-keywords">
+ <simpara>
+ <xsl:value-of select="fb:keywords/text()"/>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-date">
+ <simpara>
+ <xsl:value-of select="fb:date/text()"/>
+ <xsl:if test="fb:date/@value"> (<xsl:value-of select="fb:date/@value"/>)</xsl:if>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-coverpage">
+ <xsl:param name="my_annotation_id"/>
+ <simpara>
+ <xsl:call-template name="gentext.param">
+ <xsl:with-param name="param" select="'SeeAbr'"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xref linkend="{$my_annotation_id}"/>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-lang">
+ <simpara>
+ <xsl:value-of select="fb:lang/text()"/>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-src-lang">
+ <simpara>
+ <xsl:value-of select="fb:src-lang/text()"/>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="title-info-translators">
+ <xsl:choose>
+ <xsl:when test="count(fb:translator) > 1">
+ <itemizedlist spacing="compact">
+ <xsl:for-each select="fb:translator">
+ <listitem>
+ <simpara>
+ <xsl:apply-templates mode="bookinfo"/>
+ </simpara>
+ </listitem>
+ </xsl:for-each>
+ </itemizedlist>
+ </xsl:when>
+ <xsl:otherwise>
+ <simpara>
+ <xsl:for-each select="fb:translator">
+ <xsl:apply-templates mode="bookinfo"/>
+ </xsl:for-each>
+ </simpara>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="title-info-sequence">
+ <simpara>
+ <xsl:value-of select="fb:sequence/@name"/>
+ </simpara>
+ <simpara>
+ <xsl:if test="fb:sequence/@number">
+ <xsl:call-template name="gentext.info.param">
+ <xsl:with-param name="context" select="'title-info'"/>
+ <xsl:with-param name="param" select="'sequence.number'"/>
+ </xsl:call-template>
+ <xsl:text>: </xsl:text>
+ <xsl:value-of select="fb:sequence/@number"/>
+ </xsl:if>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="document-info-appendix">
+ <xsl:if test="count(fb:description/fb:document-info)">
+ <xsl:for-each select="fb:description/fb:document-info">
+ <xsl:call-template name="document-info-appendix-wrk"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="document-info-appendix-wrk">
+ <appendix id="{concat('document-info-appendix', generate-id())}">
+ <title>
+ <xsl:call-template name="gentext.info.title"/>
+ </title>
+ <informaltable align="center" frame="topbot" colsep="0" rowsep="1">
+ <tgroup cols="2">
+ <colspec colnum="1" colname="col1" colwidth="1*"/>
+ <colspec colnum="2" colname="col2" colwidth="2*"/>
+ <tbody>
+ <xsl:if test="count(fb:author)">
+ <row>
+ <xsl:for-each select="fb:author[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-authors"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:program-used)">
+ <row>
+ <xsl:for-each select="fb:program-used[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:program-used/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:date)">
+ <row>
+ <xsl:for-each select="fb:date[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="title-info-date"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:src-url)">
+ <row>
+ <xsl:for-each select="fb:src-url[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="document-info-src-url"/>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:src-ocr)">
+ <row>
+ <xsl:for-each select="fb:src-ocr[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:src-ocr/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:id)">
+ <row>
+ <xsl:for-each select="fb:id[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <code>
+ <?db-font-size 50% ?>
+ <xsl:value-of select="fb:id/text()"/>
+ </code>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:version)">
+ <row>
+ <xsl:for-each select="fb:version[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:version/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:history)">
+ <row>
+ <!-- TODO to bookinfo, xref + publisher element-->
+ <xsl:for-each select="fb:history[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <xsl:call-template name="document-info-history"/>
+ </entry>
+ </row>
+ </xsl:if>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </appendix>
+ </xsl:template>
+ <xsl:template name="document-info-src-url">
+ <simpara>
+ <ulink url="{fb:src-url/text()}">
+ <xsl:value-of select="fb:src-url/text()"/>
+ </ulink>
+ </simpara>
+ </xsl:template>
+ <xsl:template name="document-info-history">
+ <xsl:apply-templates select="fb:history/*"/>
+ </xsl:template>
+ <xsl:template name="publish-info-appendix">
+ <xsl:if test="count(fb:description/fb:publish-info)">
+ <xsl:for-each select="fb:description/fb:publish-info">
+ <xsl:call-template name="publish-info-appendix-wrk"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="publish-info-appendix-wrk">
+ <appendix id="{concat('publish-info-appendix', generate-id())}">
+ <title>
+ <xsl:call-template name="gentext.info.title"/>
+ </title>
+ <informaltable align="center" frame="topbot" colsep="0" rowsep="1">
+ <tgroup cols="2">
+ <colspec colnum="1" colname="col1" colwidth="1*"/>
+ <colspec colnum="2" colname="col2" colwidth="2*"/>
+ <tbody>
+ <xsl:if test="count(fb:book-name)">
+ <row>
+ <xsl:for-each select="fb:book-name[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:book-name/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:publisher)">
+ <row>
+ <xsl:for-each select="fb:publisher[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:publisher/text()"/>
+ </simpara>
+ </entry>
+ </row>
+ </xsl:if>
+ <xsl:if test="count(fb:city)">
+ <row>
+ <xsl:for-each select="fb:city[1]">
+ <xsl:call-template name="entry-tbl-title"/>
+ </xsl:for-each>
+ <entry align="left">
+ <simpara>
+ <xsl:value-of select="fb:city/...
[truncated message content] |