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


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] display email of author in articleinfo


On Thu, Jul 24, 2003 at 05:41:30PM +0200, Patrick Eisenacher wrote:
> Hiho,
> 
> finally I ventured out to do my first customizations and thanks to 
> Norm's HTML Parameter Reference I got pretty nice results :)
> 
> As I went on to individual tag customizations I got stuck. Flying over 
> Bob's XSL bible, I thought I could manage to achieve the customizations 
> that I had in mind, but given my limited XSL knowledge (or shall I say 
> non-existent ;o) I couldn't transfer its example to my problem and the 
> latest XSL stylesheets.
> 
> I have an authorgroup with 2 authors in my articleinfo. Their firstnames 
> and surnames get displayed fine, but their email tags get suppressed. 
> How can I get their email addresses to be displayed on the titlepage?

In general, if you want to add a top level element to
a titlepage, you add it in the titlepage.templates.xml
specification file and generate a new titlepage.templates.xsl.

But in this case, authorgroup is already in the spec file, but
you want to change what it does with its children.
So it can be done by customizing existing templates.

The template you want to customize is in html/titlepage.xsl:

<xsl:template match="author" mode="titlepage.mode">
  <div class="{name(.)}">
    <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3>
    <xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
    <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
  </div>
</xsl:template>


As you can see, it is processing the name, contrib,
and affiliation elements.  If your email element
was inside the affiliation, it would automatically
appear.  Otherwise, you need to add a line to
this template in your customization layer:

<xsl:template match="author" mode="titlepage.mode">
  <div class="{name(.)}">
    <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3>
    <xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
    <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
    <xsl:apply-templates mode="titlepage.mode" select="./email"/>
  </div>
</xsl:template>

This template is discussed in my book in the section
"Modify individual element templates" in 
http://www.sagehill.net/docbookxsl/HtmlCustomEx.html

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-help@lists.oasis-open.org


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