2013-04-26 27 views

回答

1

假設您的模板是採用默認身份變換的推式樣式編寫的,只需匹配前面有br的任何br即可,並且什麼也不做。

<xsl:template match="br[preceding-sibling::*[1][self::br]]"/> 

這裏是一個完整的樣式表的一個示例:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    <xsl:template match="@*|node()"> 
     <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> 
    </xsl:template> 

    <xsl:template match="br[preceding-sibling::*[1][self::br]]"/> 
</xsl:stylesheet> 
+0

爾加,當然。雙負。 – 2013-04-26 19:41:14

+0

這更像是:) +1 – JLRishe 2013-04-26 19:50:50