如何制作xsl:value-bold

时间:2014-04-02 20:15:17

标签: asp.net xml xslt

我有以下XSL代码:

          <td class="info center">
            <div class="infoBoldBlue"><xsl:value-of select="office" /></div>
            <xsl:value-of select="Address/Address1" /><br />
            <xsl:if test="Address/Address2 != ''">
                <xsl:value-of select="Address/Address2" />
              <br />
            </xsl:if>
            <xsl:value-of select="Address/City" />, <xsl:value-of select="Address/State" />
            <xsl:text> </xsl:text>
            <xsl:value-of select="Address/zip" /><br />
            <xsl:value-of select="Address/phone" />
          </td>

我试图让<xsl:value-of select="Address/Address2" />加粗。我怎么能这样做?

我尝试添加span但它无效。

1 个答案:

答案 0 :(得分:1)

只需在其周围使用强标签,如下所示:

<td class="info center">
            <div class="infoBoldBlue"><xsl:value-of select="office" /></div>
            <xsl:value-of select="Address/Address1" /><br />
            <xsl:if test="Address/Address2 != ''">
              <strong>
                <xsl:value-of select="Address/Address2" />
              </strong>
              <br />
            </xsl:if>
            <xsl:value-of select="Address/City" />, <xsl:value-of select="Address/State" />
            <xsl:text> </xsl:text>
            <xsl:value-of select="Address/zip" /><br />
            <xsl:value-of select="Address/phone" />
</td>