如何从 xslt 中的字符串中删除 <p> 标签?
How to remove <p> tag from string in xslt?
我的字符串中有 <p>
标记。我想从字符串中删除 <p>
和 </p>
。在 xslt 中可以吗?
这是我的代码
http://xsltransform.net/ehVYZNv
<xsl:variable name="bb"><p>Former Indian cricketer Sachin Tendulkar, who is an avid lover of Tennis, posted this cute picture with his wife Anjali Tendulkar at the Wimbledon’s semi-final match. He also wished Roger Federer all the best for the match. (Photo: Instagram)</p>
</xsl:variable>
=====
<xsl:value-of select="$bb" disable-output-escaping="yes"/>
预期输出
印度前板球运动员Sachin Tendulkar是网球的狂热爱好者,他在温布尔登网球公开赛的半决赛中发布了这张与妻子Anjali Tendulkar的可爱照片。他还祝罗杰·费德勒在比赛中一切顺利。 (照片:Instagram
您可以在 xslt 1.0 中使用子字符串
<xsl:value-of select="substring-before(substring-after($bb, '<p>'), '</p>')" disable-output-escaping="yes"/>
我的字符串中有 <p>
标记。我想从字符串中删除 <p>
和 </p>
。在 xslt 中可以吗?
这是我的代码 http://xsltransform.net/ehVYZNv
<xsl:variable name="bb"><p>Former Indian cricketer Sachin Tendulkar, who is an avid lover of Tennis, posted this cute picture with his wife Anjali Tendulkar at the Wimbledon’s semi-final match. He also wished Roger Federer all the best for the match. (Photo: Instagram)</p>
</xsl:variable>
=====
<xsl:value-of select="$bb" disable-output-escaping="yes"/>
预期输出
印度前板球运动员Sachin Tendulkar是网球的狂热爱好者,他在温布尔登网球公开赛的半决赛中发布了这张与妻子Anjali Tendulkar的可爱照片。他还祝罗杰·费德勒在比赛中一切顺利。 (照片:Instagram
您可以在 xslt 1.0 中使用子字符串
<xsl:value-of select="substring-before(substring-after($bb, '<p>'), '</p>')" disable-output-escaping="yes"/>