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

Problem with selecting UNIQUE attribute

Subject: Problem with selecting UNIQUE attribute
From: "Kevin Read" <kevin@xxxxxxxxxxxxxxxx>
Date: Sun, 17 Jun 2001 19:21:35 +0930
xsl sort unique attribute
I am building drop downs for the unique values of @names for each directory
at a given level in the following structure along with a list of unique
files types (using file/fileext)

The FileExt drop down works fine and sorts and filters as expected. :-)

It seems that no matter what combination of select expressions I use on the
build-dirlist I am unable to select on the unique values. :-(

I have more than likely been looking at this too long and the answer must be
simple.  Any suggestions on what is wrong with the build-dirlist template ?

<?xml version="1.0" encoding="UTF-8"?>
<dirstruct>
 <dir level="0" name="XML-0.6">
  <file level="0">
   <filename>xml.server</filename>
   <fileext>SERVER File</fileext>
   <filesize>1026</filesize>
   <filelastmod>16/05/2001 11:04:34 PM</filelastmod>
  </file>
  <file level="0">
   <filename>LICENSE</filename>
   <fileext>File</fileext>
   <filesize>26430</filesize>
   <filelastmod>16/05/2001 11:04:34 PM</filelastmod>
  </file>
  <dir level="1" name="bin">
   <file level="1">
    <filename>synergy.jar</filename>
    <fileext>Java File</fileext>
    <filesize>12568</filesize>
    <filelastmod>16/05/2001 11:04:34 PM</filelastmod>
  </file>
  </dir>
... ...
... ...
 </dir>
</dirstruct>

The following template is called via:

... ...
<xsl:call-template name="build-dirlist">
 <xsl:with-param name="LVL">0</xsl:with-param>
</xsl:call-template>
... ...
<xsl:call-template name="build-dirlist">
 <xsl:with-param name="LVL">1</xsl:with-param>
</xsl:call-template>
... ...


<xsl:template name="build-dirlist">
 <xsl:param name="LVL"/>
  <xsl:for-each select="//dir[@level=$LVL and not(preceding::parameter[@name
= @name])]">
   <xsl:sort select="@name" order="ascending" />
    <option>
     <xsl:value-of select="@name"/>
    </option>
  </xsl:for-each>
</xsl:template>

<xsl:template name="build-filelist">
 <xsl:for-each select="//file[not(fileext=preceding::fileext)]">
  <xsl:sort select="fileext" order="ascending" />
   <option>
    <xsl:value-of select="fileext"/>
   </option>
 </xsl:for-each>
</xsl:template>


Kevin


 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.