[xsl] RE: nested p elements in output (was: no subject)

Subject: [xsl] RE: nested p elements in output (was: no subject)
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 9 Aug 2002 09:42:15 +0100
> What is occurring is that the first p of each section is 
> being matched, but 
> instead of replacing the matched p, it will make that matched 
> "p" a child 
> of a new element "p".

That's because you asked it to.
> 
> <xsl:template match="section/p[position()=1]">
> <p class="firstsentence">
>    <xsl:copy>
>        <xsl:copy-of select="@*"/>

The outer <p> element is created by your <p> literal result element. The
inner one is created by your <xsl:copy>. Just get rid of the <xsl:copy>.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread