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 / F24998_ShowSplit.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.4 KB  |  36 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       Recursion
  4.   Author:         David Silverlight
  5.                   HeadGeek@xmlpitstop.com
  6.   Created:        2001-05-16
  7.   Description:-
  8.     This stylsheet demonstrates recursion by seperating the
  9.     contents of a single element named 'computerlanguages' into
  10.     a number of child elemements named 'computerlanguage'.
  11. ================================================================ -->
  12. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  13.     <xsl:output method="xml" indent="yes"/>
  14.     <xsl:include href="Split.xsl"/>
  15.     <!-- Template for root rule -->
  16.     <xsl:template match="/">
  17.         <employees>
  18.             <xsl:apply-templates/>
  19.         </employees>
  20.     </xsl:template>
  21.     <xsl:template match="employees">
  22.         <xsl:for-each select="employee">
  23.             <employee>
  24.                 <xsl:copy-of select="employeename"/>
  25.                 <xsl:copy-of select="department"/>
  26.                 <!-- Call the template that will trim off right spaces (recursively, of course ) -->
  27.                 <computerlanguages>
  28.                     <xsl:call-template name="Split">
  29.                         <xsl:with-param name="strInput" select="computerlanguages"/>
  30.                         <xsl:with-param name="strDelimiter" select="','"/>
  31.                     </xsl:call-template>
  32.                 </computerlanguages>
  33.             </employee>
  34.         </xsl:for-each>
  35.     </xsl:template>
  36. </xsl:stylesheet>