Headlines

Jul 13, 2008 at 11:31 AM
Thank you Yves for you answer on my last topic! Worked out perfect.
This time, I would like to sort my references in the reference list under headlines, something like this:

Books:

Saunders, Malcolm, (1994) Strategic Purchasing & Supply Chain Management, London, Pitman Publishing

 

 

Van Weele, Arjan, (2005) Purchasing & Supply Chain Management, London, Thomson Learning

 

Articles:
Krajlic, Peter, (1983) Purchasing must become Supply Chain Management, Harvard Business Review, Issue:Sep/Okt

Any Ideas?

Jul 13, 2008 at 11:32 AM

Aricles:

Krajlic, Peter., (1983) Purchasing must become Supply Chain Management, Harvard Business Review, Issue:Sep/Okt


Any ideas?

Jul 13, 2008 at 3:08 PM
And second question =) How to call a co-author? I can select the whole string but I just wante the last names and sure add some space between them, Like:

Peterson & Anderson (2005)
Jul 14, 2008 at 7:33 PM
Edited Jul 14, 2008 at 7:34 PM
Second question solved:
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person[2]/b:Last"/>
Coordinator
Jul 19, 2008 at 1:20 AM
Edited Jul 19, 2008 at 1:21 AM

It is nice to see that you were already able to answer part of the questions yourself. Regarding your first question. Personally, I would write a small template to handle each type separately. For example my template function would look like this:

<xsl:template name="grouped-bibliography">
  <!--
Name of the group (e.g. 'Books', 'Book Sections', ...) -->
  <
xsl:param name="name"/>
  <!--
Source type belonging to the name. -->
  <
xsl:param name="type"/>

  <
p class="MsoBibliography">
    <
b>
      <
xsl:value-of select="$name"/>
      <
xsl:text>(</xsl:text>
      <
xsl:value-of select="count(/b:Bibliography/b:Source[b:SourceType = $type])"/>
      <
xsl:text>)</xsl:text>
    </
b>
  </
p>

  <
xsl:for-each select="/b:Bibliography/b:Source[b:SourceType = $type]">
    <
xsl:sort select="b:RefOrder" data-type="number"/>
   
    <
p class="MsoBibliography">
      <
xsl:value-of select="./b:RefOrder"/>
      <
xsl:text> - </xsl:text>
      <
xsl:value-of select="./b:Author/b:Author/b:NameList/b:Person[1]/b:Last"/>
      <
xsl:text> - </xsl:text>
      <
xsl:value-of select="./b:Title"/>
    </
p>
  </
xsl:for-each>
</
xsl:template>

 

 

And the formatting routine would then be something like this (part of <xsl:template match="/">):

<
xsl:when test="b:Bibliography">
  <
html xmlns="http://www.w3.org/TR/REC-html40">
    <
head>
    </
head>
    <
body>
      <
xsl:call-template name="grouped-bibliography">
        <
xsl:with-param name="name" select="'Books'"/>
        <
xsl:with-param name="type" select="'Book'"/>
      </
xsl:call-template>

      <
xsl:call-template name="grouped-bibliography">
        <
xsl:with-param name="name" select="'Book Sections'"/>
        <
xsl:with-param name="type" select="'BookSection'"/>
      </
xsl:call-template>
    </
body>
  </
html>
</
xsl:when 

 

 

You could of course make separate templates for every type as well then.

HTH