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

Re: distinct values

Subject: Re: distinct values
From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx>
Date: Tue, 8 Jun 1999 13:01:42 -0400
xsl distinct values
In the Microsoft implementation the variable could be eliminated  with:

From: David Carlisle <davidc@xxxxxxxxx>...

 <xsl:template match="*">
   <xsl:if
test="not(from-preceding-siblings(*[qname(.)=context().qname(.)]))">
   [[<xsl:value-of select="qname(.)"/>]]
   </xsl:if>
 </xsl:template>

which leads me to:

 <xsl:template match="root">
    <xsl:choose>
       <xsl:when test="../*[(index() $lt$ context()!index()) $and$
(nodeName() = context()!nodeName())][0]">
       </xsl:when>
       <xsl:otherwise>
            <xsl:node-name/>
       </xsl:otherwise>
      </xsl:choose>
 </xsl:template>

Which works!

My mistake was in try to approach the problem from a sorting perspective. It
is much easier just to test for membership in the set of previous nodes.

Jon Smirl
jonsmirl@xxxxxxxxxxxx



 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.