Subject: Re: [xsl] Copy Child Elements From: "Rick Quatro" <frameexpert@xxxxxxxxxxxx> Date: Sat, 26 Jan 2008 09:45:18 -0500 |
<xsl:template match="p[position()=1]"> <dt> <xsl:copy-of select="text()|*" /> </dt> </xsl:template>
<xsl:template match="p[position()=2]"> <dd> <xsl:copy-of select="text()|*" /> </dd> </xsl:template>
Rick Quatro Carmen Publishing 585-659-8267 www.frameexpert.com
Don't use for-each here. Instead, use
<xsl:apply-templates select="p" />
and follow up with matching templates like the following. The last one is a so-called throw-away template, it will be called when a <p> matches that did not match any more specific match:
<xsl:template match="p[id='Field_ShowAuthorJobTitle']> <dt> <xsl:copy-of select="text() | *" /> </dt> </xsl:template>
<xsl:template match="p[id='Desc_ShowAuthorJobTitle']> <dd> <xsl:copy-of select="text() | *" /> </dd> </xsl:template>
<!-- throw away other <p> elements --> <xsl:template match="p" />
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Copy Child Elements, Abel Braaksma | Thread | [xsl] Request help in understanding, Costello, Roger L. |
Re: [xsl] Copy Child Elements, Abel Braaksma | Date | Re: [xsl] combining multiple docume, David Carlisle |
Month |