← Prev in month ← Prev in thread
Next in thread → Next in month →

Rendering <person> with <email> Link in fo

From
Lou Springer <>
Date
2008-03-07T04:14:28+00:00
ID
Thread
Rendering <person> with <email> Link in fo
I need a review of the following customization.

I have an fo customization that provides a mailto uri link for <person> 
tags that contain a <personname> and an <email>

<xsl:template match="person">
    <xsl:call-template name="simple.xlink">
        <xsl:with-param name="content">
            <xsl:call-template name="person.name"/>
        </xsl:with-param>
        <xsl:with-param name="xhref">
            <xsl:if test="email">
                <xsl:text>mailto:</xsl:text>
                <xsl:copy-of select="email"/>
            </xsl:if>
        </xsl:with-param>
    </xsl:call-template>
</xsl:template>

So this produces the desired results for <person> tags like:

<person>
  <personname>Louis F. Springer</personname>
  <email></email>
</person>

It properly handles the case where no <email> is provided.

Have I planted any logic bombs with this solution?

Lou
← Prev in month ← Prev in thread
Next in thread → Next in month →