我有一个这样的 XML 结构,只是一些与 HTML 标记混合的有效 XML 结构。我正在尝试匹配<p>MyHeader</p>
该部分并将其设置为空。
那是在这个结构上运行 XSLT 之后,我不想打印<p>MyHeader</p>
标签。
<abstract>
<section>
<p>MyHeader</p>
<p> other content in section </p>
<h1> other content in section </h1>
</section>
</abstract>
这是我在 XSL 中尝试的内容
<xsl:template match="abstract/section/p">
<xsl:choose>
<xsl:when test="text() ='MyHeader'"></xsl:when>
<xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
</xsl:choose>
</xsl:template>
关于我上面的代码有什么问题的任何想法?我没有看到<p>MyHeader</p>
标签被剥离。