[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Set of distinct values
Hi, Jason: You can achieve what you needed using preceding axis like the following: <distinct> <xsl:for-each select="root/node[not(.=preceding::node)]"> <node><xsl:value-of select="."/></node> </xsl:for-each> </distinct> Xiaocun --- Jason Macki <jmacki@xxxxxxx> wrote: > Hello, > > I was wondering anyone can suggest a way that XSL > can select a set of > distinct values from an XML document, similar to a > "Select DISTINCT" > command in SQL. > > For example, I'd like to transform this: > > <root> > <node>a</node> > <node>b</node> > <node>c</node> > <node>a</node> > <node>b</node> > <node>c</node> > <node>a</node> > <node>b</node> > <node>c</node> > <node>a</node> > <node>b</node> > <node>c</node> > <node>d</node> > </root> > > Into this => > > <distinct> > <node>a</node> > <node>b</node> > <node>c</node> > <node>d</node> > </distinct> > > Thanks, > Jason > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ 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
|