[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How do you get the most recent element?
> but an alternatative to > > > <xsl:template match="note"> > <xsl:if test="position()=1"> > <xsl:value-of select="text"/> > </xsl:if> > </xsl:template> > is > > <xsl:template match="note"/> > <xsl:template match="note[1]"> > <xsl:value-of select="text"/> > </xsl:template> > Wrong, David, and I nearly made the same mistake myself! match=note[1] will match any note that is the first note child of its parent, the test on position() will match the first note in the list being processed by apply-templates. Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|