[xsl] not matching empty text nodes.

Subject: [xsl] not matching empty text nodes.
From: Terence <tk.lists@xxxxxxxxxxx>
Date: Thu, 06 Feb 2003 12:03:18 +1100
This is obviously a newbie question.

Say I have

    <xsl:template match="/album/photos/photo/caption">
        <tr valign="top">
            <td class="label" align="right">caption:</td>
            <td class="caption"><xsl:value-of select="." /></td>
        </tr>
    </xsl:template>

My problem is that I _don't_ want to execute this template if there is no text content in the "caption" element.








Another question...


how do I provide a one-template solution to all elements which have the same requirements as caption?
For instance, there are more of these...


    <xsl:template match="/album/photos/photo/description">
        <tr valign="top">
            <td class="label" align="right">description:</td>
            <td class="caption"><xsl:value-of select="." /></td>
        </tr>
    </xsl:template>

    <xsl:template match="/album/photos/photo/location">
        <tr valign="top">
            <td class="label" align="right">location:</td>
            <td class="caption"><xsl:value-of select="." /></td>
        </tr>
    </xsl:template>


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread