[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] sorting a bibliography
I think part of the problem is the white space characters (line breaks) inside some <title> elements: <title> Converting HTML to Docbook SGML/XML Using html2db </title> The sort process includes those characters. The normalize-space() function in XSLT will eliminate the leading whitespace. For a title sort, you probably also want to fold upper and lower case, and ignore punctuation. So try this version of sort: <xsl:sort select="translate(normalize-space(title), 'abcdefghijklmnopqrstuvwxyz.-_,()/:;', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" data-type="text" order="ascending"/> After removing the leadings and trailing whitespace, the translate() function maps lowercase to uppercase. The punctuation characters in the first list of characters don't have matching characters in the second list, so they are ignored in the sort. The specific problem with the "Linux Documentation Project (LDP) FAQ" title is that it is in its own bibliodiv, followed by another bibliodiv without a title. 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 10:15 AM Subject: Re: [docbook-apps] sorting a bibliography > On Wed, Dec 10, 2003 at 09:54:13AM -0800, Bob Stayton wrote: > > The problem was selection and context. Try this one: > > Thanks, that works! (Almost) > > One of the sections is still not being correctly sorted though. > The output is: > Linux Documentation Project (LDP) FAQ > CVS . > CVS--Concurrent Versions System . > CVS: Project Management . > Learning About CVS . > > But the markup is identical to the other bibliodivs... > http://xtrinsic.com/geek/articles/output.html#bibliography (warning: > 250K!) > http://xtrinsic.com/geek/articles/references.xml (it's only a fragment > of the much, much longer document) > to sample the weirdness. It's especially a problem in the longer > bibliodivs. > > > 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. > > It'll take me a number of readings to understand this. I'm generally good > with the DOM and SQL select statements, but I don't grok that paragraph > yet. It's ok though, I understand what it's doing, I just don't understand > the language yet. > > > And I think you want order="ascending", right? > > D'oh! Yes. :) > > 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/. > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]