This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Re: sorting bibliography by authors
- From: Yoshihiro Toda <ystoda at yahoo dot co dot jp>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Fri, 19 Nov 2004 12:12:04 +0900
- Subject: [docbook-apps] Re: sorting bibliography by authors
- References: <419CE2C7.1060204@netscape.net>
Hi, Deepak. Try these templates.
For HTML processing:
<xsl:template match="bibliography">
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="bibliography.titlepage"/>
<xsl:apply-templates>
<xsl:sort select=".//surname"/>
</xsl:apply-templates>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:template>
For FO:
<xsl:template match="bibliography">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(parent::*) or parent::part or parent::book">
<xsl:variable name="master-reference">
<xsl:call-template name="select.pagemaster"/>
</xsl:variable>
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<fo:flow flow-name="xsl-region-body">
<fo:block id="{$id}">
<xsl:call-template name="bibliography.titlepage"/>
</fo:block>
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</xsl:when>
<xsl:otherwise>
<fo:block id="{$id}"
space-before.minimum="1em"
space-before.optimum="1.5em"
space-before.maximum="2em">
<xsl:call-template name="bibliography.titlepage"/>
</fo:block>
<xsl:apply-templates>
<xsl:sort select=".//surname"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
# BTW, is there any way to define `advice' (in elisp sense) in XSLT?
--
Yoshihiro Toda
yoshihiro_toda@mac.com
__________________________________
Do You Yahoo!?
Upgrade Your Life
http://bb.yahoo.co.jp/