该xsl:apply-templates
指令:
<xsl:if test="$item/tcm:Content/em:Office/em:Address">
<address>
<xsl:apply-templates mode="renderhtml" select="$item/tcm:Content/em:Office/em:Address/node()" />
</address>
</xsl:if>
产生:
<p>
My Office Address
<br />XXXX Road
<br />XXXX District
<br />XXXX, XXXX.
<br />PO Box XXXX
</p>
现在我想将生成的 html 存储在一个变量中,然后调用另一个模板将第一个<p>
元素替换为<p property="v:street-address">
,以便最终结果为:
<p property="v:street-address">
My Office Address
<br />XXXX Road
<br />XXXX District
<br />XXXX, XXXX.
<br />PO Box XXXX
</p>
请推荐!!
谢谢