[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Simple XPath question

Subject: Re: Simple XPath question
From: Phil Lanch <phil@xxxxxxxxxxxxxxx>
Date: Tue, 23 Nov 1999 10:19:16 +0000
lanch rush
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.