docbook: Thread: transformations: alphabetizing bibliographies


[<<] [<] Page 1 of 2 [>] [>>]
Subject: transformations: alphabetizing bibliographies
From: Emma Jane Hogbin ####@####.####
Date: 8 Dec 2003 21:18:27 -0000
Message-Id: <20031208211805.GB4474@debian>

I know virtually nothing about manipulating XML documents; however, I'm
wondering how hard it would be to have a customized XSLT (?) that sorted
the bibliography in one of my documents so that it was alphabetically
correct.

Currently I do this:
xsltproc -o output.html \
	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/tldp-html.xsl \
	file.xml

thanks!!
emma

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]
Subject: Re: transformations: alphabetizing bibliographies
From: Saqib Ali ####@####.####
Date: 8 Dec 2003 21:27:20 -0000
Message-Id: <Pine.GSO.4.55.0312081308290.15456@sjgcs1.stsj.seagate.com>

Emma,

If I understand correctly, what you need is a XSLT that does

DocBook XML -> DocBook XML

The resulting output should have a sorted glossary/bibliography.

And then you can process the output using the DocBook/TLDP XSL to produce the
HTML output.

Writing a XSLT to perform this function, may not easy.

I will look through my XSLT books to find a solution for this.

Saqib Ali
-------------
http://validate.sf.net <---- HTML/XHTML/DocBook Validator

On Mon, 8 Dec 2003, Emma Jane Hogbin wrote:

> I know virtually nothing about manipulating XML documents; however, I'm
> wondering how hard it would be to have a customized XSLT (?) that sorted
> the bibliography in one of my documents so that it was alphabetically
> correct.
>
> Currently I do this:
> xsltproc -o output.html \
> 	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/tldp-html.xsl \
> 	file.xml
>
> thanks!!
> emma
>
> --
> Emma Jane Hogbin
> [[ 416 417 2868 ][ www.xtrinsic.com ]]
>
> ______________________
> http://lists.tldp.org/
>
>
Subject: Re: transformations: alphabetizing bibliographies
From: "John R. Daily" ####@####.####
Date: 8 Dec 2003 21:35:06 -0000
Message-Id: <200312082135.hB8LZ4Bs012071@ms-smtp-03-eri0.ohiordc.rr.com>

At (time_t)759481298 Emma Jane Hogbin wrote:

> I know virtually nothing about manipulating XML documents; however, I'm
> wondering how hard it would be to have a customized XSLT (?) that sorted
> the bibliography in one of my documents so that it was alphabetically
> correct.

xsl:sort is probably what you want, but I'd have to do some
experimentation as time permits to figure out how best to leverage
it.

What do you want to sort by?  Will words like "The" be pushed to
the back of the title (assuming you want to sort by title)?

-John

Subject: Re: transformations: alphabetizing bibliographies
From: Emma Jane Hogbin ####@####.####
Date: 8 Dec 2003 21:43:30 -0000
Message-Id: <20031208214308.GA5111@debian>

On Mon, Dec 08, 2003 at 04:35:04PM -0500, John R. Daily wrote:
> xsl:sort is probably what you want, but I'd have to do some

Sounds about right. I /may/ try looking into it myself, but I'm already
running /way/ behind on a project that pays. :(

> What do you want to sort by?  Will words like "The" be pushed to
> the back of the title (assuming you want to sort by title)?

By title. "The" documents are written up as Title, The.

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]
Subject: Re: transformations: alphabetizing bibliographies
From: Saqib Ali ####@####.####
Date: 8 Dec 2003 22:00:59 -0000
Message-Id: <Pine.GSO.4.55.0312081337540.16010@sjgcs1.stsj.seagate.com>

John,

Will something like the following work???

<xsl:sort
select=document/article/bibliography/bibilioentry[.=current()]"
order="ascending" />

Thanks.
Saqib Ali
-------------
http://validate.sf.net <---- HTML/XHTML/DocBook Validator

On Mon, 8 Dec 2003, John R. Daily wrote:

> At (time_t)759481298 Emma Jane Hogbin wrote:
>
> > I know virtually nothing about manipulating XML documents; however, I'm
> > wondering how hard it would be to have a customized XSLT (?) that sorted
> > the bibliography in one of my documents so that it was alphabetically
> > correct.
>
> xsl:sort is probably what you want, but I'd have to do some
> experimentation as time permits to figure out how best to leverage
> it.
>
> What do you want to sort by?  Will words like "The" be pushed to
> the back of the title (assuming you want to sort by title)?
>
> -John
>
>
> ______________________
> http://lists.tldp.org/
>
>
Subject: Re: transformations: alphabetizing bibliographies
From: "John R. Daily" ####@####.####
Date: 8 Dec 2003 22:30:15 -0000
Message-Id: <200312082230.hB8MUDBs019020@ms-smtp-03-eri0.ohiordc.rr.com>

At (time_t)759482524 Saqib Ali wrote:

> <xsl:sort
> select=document/article/bibliography/bibilioentry[.=current()]"
> order="ascending" />

Here's a modified example from "XSLT for Dummies", my favorite
quick-hit reference book.  Note that I don't understand
bibliographies, so I've simplified (and probably broken) the
select; also note that in order this to work, there'd
have to be a way to call the original bibliography template, or
this would have to be incorporated into a replacement template.

<xsl:template match="bibliography">
  <xsl:apply-templates>
    <xsl:sort select="biblioentry/title" data-type="text" order="ascending"/>
  </xsl:apply-templates>
</xsl:template>

-John

Subject: Re: transformations: alphabetizing bibliographies
From: Emma Jane Hogbin ####@####.####
Date: 8 Dec 2003 23:21:11 -0000
Message-Id: <20031208232047.GA6043@debian>

On Mon, Dec 08, 2003 at 05:30:13PM -0500, John R. Daily wrote:
> At (time_t)759482524 Saqib Ali wrote:
> > <xsl:sort
> > select=document/article/bibliography/bibilioentry[.=current()]"
> > order="ascending" />
> 
> <xsl:template match="bibliography">
>   <xsl:apply-templates>
>     <xsl:sort select="biblioentry/title" data-type="text" order="ascending"/>
>   </xsl:apply-templates>
> </xsl:template>

I don't really understand if I'm pasting that information into the right
place; however both yield errors...

<xsl:template match="bibliodiv">
  <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
    <xsl:apply-templates/>
      <xsl:sort select="document/article/bibliography/bibilioentry[.=current()]" data-type="text" or
der="descending"/>
  </div>
</xsl:template>



runtime error: file /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/biblio.xsl line 61 element sort
xsl:sort : improper use this should not be reached


-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]
Subject: Re: transformations: alphabetizing bibliographies
From: "John R. Daily" ####@####.####
Date: 9 Dec 2003 00:53:18 -0000
Message-Id: <200312090053.hB90rE0Z019857@ms-smtp-02-eri0.ohiordc.rr.com>

At (time_t)759486519 Emma Jane Hogbin wrote:

> <xsl:template match="bibliodiv">
>   <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
>     <xsl:apply-templates/>
>       <xsl:sort select="document/article/bibliography/bibilioentry[.=current()]" data-type="text" order="descending"/>
>   </div>
> </xsl:template>

Your error may result from closing apply-templates early.  Instead:

  <xsl:apply-templates>
    <xsl:sort ...>
  </xsl:apply-templates>

-John
Subject: Re: transformations: alphabetizing bibliographies
From: Emma Jane Hogbin ####@####.####
Date: 9 Dec 2003 19:32:02 -0000
Message-Id: <20031209193135.GB11042@debian>

On Mon, Dec 08, 2003 at 07:53:14PM -0500, John R. Daily wrote:
> At (time_t)759486519 Emma Jane Hogbin wrote:
> 
> > <xsl:template match="bibliodiv">
> >   <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
> >     <xsl:apply-templates/>
> >       <xsl:sort select="document/article/bibliography/bibilioentry[.=current()]" data-type="text" order="descending"/>
> >   </div>
> > </xsl:template>
> 
> Your error may result from closing apply-templates early.  Instead:
> 
>   <xsl:apply-templates>
>     <xsl:sort ...>
>   </xsl:apply-templates>

Hmm, I'm no longer getting errors, but it's still not sorting the entries.

emma

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]
Subject: Re: transformations: alphabetizing bibliographies
From: "John R. Daily" ####@####.####
Date: 9 Dec 2003 19:41:50 -0000
Message-Id: <200312091941.hB9JfmBs004253@ms-smtp-03-eri0.ohiordc.rr.com>

At (time_t)759538038 Emma Jane Hogbin wrote:

> Hmm, I'm no longer getting errors, but it's still not sorting the entries.

I'm not confident that the select attribute is right, but again
my ignorance of bibliographies is limiting my ability to diagnose.

If you're using biblioentries, try selecting the value I'd
originally proposed, select="biblioentry/title".

-John
[<<] [<] Page 1 of 2 [>] [>>]


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.