我有以下过程的XML
<p>In technical jargon<sup></sup>, the expect<span class="insert"></span><span class="insert"></span><span class="insert">ed</span> excess return on a factor is proportional to the negative of the factor covariance with the pricing kernel, <br/>given by marginal utility of consumption for a representative agent.</p>我使用下面的xsl来删除span空标记。
<xsl:template match=
"*[not(span)
and normalize-space()=''
]"/>通过XSL输出。它移除所有空标签。
<p>In technical jargon, the expect<span class="insert">ed</span> excess return on a factor is proportional to the negative of the factor covariance with the pricing kernel, given by marginal utility of consumption for a representative agent.</p>但只删除span空标签。所以我需要下面的XML
<p>In technical jargon<sup></sup>, the expect<span class="insert">ed</span> excess return on a factor is proportional to the negative of the factor covariance with the pricing kernel, <br/>given by marginal utility of consumption for a representative agent.</p>谢谢你提前。
发布于 2014-05-29 08:24:27
使用
<xsl:template match=
"*[self::span
and normalize-space()=''
]"/>发布于 2014-05-29 08:36:40
如果只想删除span,则使模板仅匹配跨范围。
<xsl:template match="span[not(span)
and normalize-space()='']"/>https://stackoverflow.com/questions/23928818
复制相似问题