|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Simple XPath question
Nikita Ogievetsky wrote: > > You are right. I did this in a rush and missed this case. > The following constructs works with your fragment correctly: > > <xsl:for-each select="PERSON"> > <xsl:if test="following-sibling::PERSON[current()/@lastname = > ./@lastname and current()/@firstname = ./@firstname]"> > <xsl:if test="not(preceding-sibling::PERSON[current()/@lastname = > ./@lastname and current()/@firstname = ./@firstname])"> > <xsl:copy-of select="."/> > </xsl:if> > </xsl:if> > </xsl:for-each> Yes: neat. I'd never really noticed the current() function before; it looks very useful. Again, current() is only in XSLT, not XPath, so this doesn't meet Paul's request for an XPath solution. But (drifting off-topic) why should XPath have a current() function when XPointer, the other spec that uses XPath, doesn't need it (since in XPointer it would always return the same value as /)? -- cheers phil '"having more of a life is one of the earliest and subtlest signs of mediocrity"' --- Musil 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
|

Cart








