Subject: Re: [xsl] Getting the first p inside a div From: Walter Lee Davis <waltd@xxxxxxxxxxxx> Date: Tue, 19 Aug 2008 12:25:13 -0400 |
Something like this:
<xsl:template match="note//p">
<p class="note_p">
<xsl:if test="generate-id() = generate-id(ancestor::note/ descendant::p[1])">
<xsl:apply-templates select="ancestor::note/label"/>
</xsl:if>
<xsl:apply-templates/>
</p>
</xsl:template>
What this does:
* Collapse the templates together for all p elements inside note, rather than splitting a template out for the first p. This is clearer, allows better code reuse, and is more robust.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Getting the first p insid, Wendell Piez | Thread | [xsl] change td background with XSL, henry human |
Re: [xsl] Getting the first p insid, Wendell Piez | Date | [xsl] change td background with XSL, henry human |
Month |