A template matching issue

Leo Wyatt

New Member
I have a source html looks like:\[code\]<p class="heading-8">Emergency Care<span class="char-style-override-68">, if not already done:</span></p><p class="List-Bullet-CHAM1-CHAM-1-List-Bullet-1 para-style-override-3"><span> </span><span class="char-style-override-25">1.</span><span> Do Initial Assessment (p. 72).</span></p>\[/code\]Now I create a template match for p:\[code\]<xsl:template match="x:p"><xsl:choose> <xsl:when test="contains(@class,'heading-8')"> <xsl:variable name="current-name" select="generate-id(.)"/> <xsl:variable name="noTable" select="count(preceding-sibling::x:table)"/> <p> <b> <xsl:apply-templates/> </b> </p> <xsl:if test="following-sibling::*[1][self::x:p][contains(@class,'List-Bullet-CHAM1-CHAM-1')][generate-id(preceding-sibling::x:p[contains(@class,'heading-8 ')][1]) = $current-name]"> <ol> <xsl:apply-templates select="following-sibling::x:p[contains(@class,'List-Bullet-CHAM1-CHAM-1')][count(preceding-sibling::x:table)=$noTable][generate-id(preceding-sibling::x:p[contains(@class,'heading-8 ')][1]) = $current-name]" mode="bullet"/> </ol> </xsl:if> </xsl:when>\[/code\]The issue I am having now is that it seems that I could never get in to that inner if branch. But I think the source html matches perfectly with it, just don't know where I could be wrong.PS, I used generate-id() function to determine the identity of a preceding sibling node.
 
Back
Top