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

removing duplicates in loops

Subject: removing duplicates in loops
From: Yi Qin <yiqin@xxxxxxxxxxxxxxx>
Date: Mon, 1 Apr 2002 23:20:19 -0700 (MST)
xsl rowset
i have the following xsl and want to remove repeated education
and honor elements.  how should i achieve that?


<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="rowset">
    <xsl:for-each
select="/rowset/row/resumeid[not(preceding::resumeid=.)]">
      <xsl:sort select="."/>
      <resume id="{.}">
        <name>
          <first_name><xsl:value-of
select="/rowset/row/fname"/></first_name>
          <middle_initial><xsl:value-of
select="/rowset/row/middle"/></middle_initial>
	  <last_name><xsl:value-of
select="/rowset/row/lname"/></last_name>
	  <maiden_name><xsl:value-of
select="/rowset/row/maiden"/></maiden_name>
	  <suffix><xsl:value-of select="/rowset/row/suffix"/></suffix>
	</name>
	<objective><xsl:value-of
select="/rowset/row/objective"/></objective>
 	<xsl:for-each select="/rowset/row[resumeid = current()]">
          <education>
       	    <school><xsl:value-of select="school"/></school>
       	    <department><xsl:value-of select="dept"/></department>
       	    <school_address>
       	      <school_city><xsl:value-of select="city"/></school_city>
       	      <school_state><xsl:value-of select="state"/></school_state>
       	      <school_country><xsl:value-of
select="country"/></school_country>
       	    </school_address>
       	    <degree><xsl:value-of select="degree"/></degree>
       	    <major><xsl:value-of select="major"/></major>
       	    <minor><xsl:value-of select="minor"/></minor>
       	    <grad_date><xsl:value-of select="gdate"/></grad_date>
 	    <gpa>
 	      <major_gpa><xsl:value-of select="magpa"/></major_gpa>
 	      <minor_gpa><xsl:value-of select="migpa"/></minor_gpa>
 	      <overall_gpa><xsl:value-of select="ovgpa"/></overall_gpa>
 	      <class_standing><xsl:value-of select="cs"/></class_standing>
 	    </gpa> 	    
   	  </education>
 	</xsl:for-each>
 	<xsl:for-each select="/rowset/row[resumeid = current()]">
  	  <honor>
   	    <honor_name><xsl:value-of select="hname"/></honor_name>
   	    <honor_date><xsl:value-of select="hdate"/></honor_date>
  	  </honor>
 	</xsl:for-each>  
      </resume>        
    </xsl:for-each>    
  </xsl:template>
</xsl:stylesheet>



 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.