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

RE: Why does this work?

Subject: RE: Why does this work?
From: "Spychalski, Frank" <frank.spychalski@xxxxxxx>
Date: Mon, 7 Aug 2000 19:50:59 +0200
RE: Why does this work?
Hi,

...
->I solved it with the following template (this assumes that the data is
->ordered by customer):
->
-><xsl:template match="row">
-> <xsl:choose>
->  <xsl:when test="customer = preceding::row[position()=1]/customer">
->   <td>&nbsp;</td>
->  </xsl:when>
->  <xsl:otherwise>
->   <td><xsl:value-of select="customer"/>
->  </xsl:otherwise>
-> </xsl:choose>
-> <td><xsl:value-of select="account"/></td>
-></xsl:template>
->
->Now I'm glad it works, but for some peace of mind I would 
->like to know why 
-><xsl:when test="customer = preceding::row[position()=1]/customer"> 
->behaves as it does?

You take the preceding axis gives you the elements before your element in
reverse order, the element directly before your current element is the one
you get first.  And because your input is sorted that's why your stylesheet
works...

->Thanks in advance,
->Christian Schmitt

bye
Frank
-
Frank Spychalski
Research Engineer
SAP Labs, Palo Alto           frank.spychalski@xxxxxxx 


 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.