Subject: Re: [xsl] Getting the first p inside a div From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 19 Aug 2008 14:26:17 -0400 |
<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.
I agree (about the robustness), and it works perfectly.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] change td background with XSL, henry human | Thread | [xsl] using xsl:result-document in , Mark Wilson |
Re: [xsl] using xsl:result-document, Mark Wilson | Date | [xsl] Unexpected result from <a hre, Quinn Taylor |
Month |