home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F34968_makeDistinct.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-12-19  |  1.2 KB  |  35 lines

  1. ∩╗┐<xsl:stylesheet version="1.0"
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:mytestElem="f:mytestElem"
  4. >
  5.     <xsl:import href="foldl.xsl"/>
  6.     
  7.     <xsl:output indent="yes" omit-xml-declaration="yes"/>
  8.     <mytestElem:mytestElem/>
  9.     <xsl:template match="/">
  10.       <xsl:variable name="vFun-testElem"
  11.                     select="document('')/*/mytestElem:*[1]"/>
  12.  
  13.       <xsl:call-template name="foldl">
  14.         <xsl:with-param name="pFunc" select="$vFun-testElem"/>
  15.         <xsl:with-param name="pA0" select="/.."/>
  16.         <xsl:with-param name="pList"
  17.                         select="document('testDistinct1.xml')/p/person
  18.                               | document('testDistinct2.xml')/p/person
  19.                               | document('testDistinct3.xml')/p/person"
  20.       />
  21.       </xsl:call-template>
  22.     </xsl:template>
  23.     
  24.     <xsl:template match="mytestElem:*">
  25.       <xsl:param name="arg1" select="/.."/>
  26.       <xsl:param name="arg2" select="/.."/>
  27.       
  28.       <xsl:copy-of select="$arg1"/>
  29.       <xsl:if test="not($arg2/@id = $arg1/*/@id)">
  30.         <xsl:copy-of select="$arg2"/>
  31.       </xsl:if>
  32.     </xsl:template>
  33. </xsl:stylesheet>
  34.  
  35.