This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] sorting a bibliography


The problem was selection and context.  Try this one:

<xsl:template match="bibliodiv">
  <div xmlns="http://www.w3.org/1999/xhtml"; class="{name(.)}">
    <xsl:apply-templates select="*[not(self::biblioentry)]"/>
    <xsl:apply-templates select="biblioentry">
        <xsl:sort select="title" data-type="text" order="ascending"/>
    </xsl:apply-templates>
  </div>
</xsl:template>

In this version, it selects the non-biblioentry children
of the bibliodiv to process first,
so your bibliodiv title doesn't get sorted.  Then it selects the
biblioentry elements for sorting.  For the sort, the context is
each biblioentry element, so specify its child "title" in the
select attribute.  And I think you want order="ascending",
right?

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Emma Jane Hogbin" <emmajane@xtrinsic.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, December 10, 2003 9:27 AM
Subject: [docbook-apps] sorting a bibliography


> Hi,
>
> I'm currently working on a document for the Linux Documentation Project.
> Alas, I am a lazy author (or perhaps that should read: moderately horrid
> at alphabetical correctness) but moderately good with google. I have a
> gaggle of items in my bibliography, but they are not in order.
>
> I'd like to tweak my biblio.xsl (nwalsh) file so that each <bibliodiv />
> is sorted alphabetically by <biblioentry /><title /> when the document is
> output to XHTML.
>
> /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/biblio.xsl
> contains:
> <xsl:template match="bibliodiv">
>   <div xmlns="http://www.w3.org/1999/xhtml"; class="{name(.)}">
>     <xsl:apply-templates>
>          <xsl:sort select="bibilioentry/title" data-type="text"
order="descending"/>
>     </xsl:apply-templates>
>   </div>
> </xsl:template>
>
> Although this throws up no errors, it does not sort the bibliography by
> title in the output XHTML file.
>
> Thank you for any help you may be able to give me,
> emma
>
> -- 
> Emma Jane Hogbin
> [[ 416 417 2868 ][ www.xtrinsic.com ]]
>
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
>
>


To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]