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 / F41356_strdropWhile.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  1.3 KB  |  37 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. exclude-result-prefixes="xsl"
  3. >
  4.   <xsl:template name="str-dropWhile">
  5.     <xsl:param name="pStr" select="''"/>
  6.     <xsl:param name="pController" select="/.."/>
  7.     <xsl:param name="pContollerParam" select="/.."/>
  8.  
  9.     <xsl:if test="not($pController)">
  10.       <xsl:message terminate="yes">[str-dropWhile]Error: pController not specified.</xsl:message>
  11.     </xsl:if>   
  12.     
  13.       <xsl:if test="$pStr">
  14.         <xsl:variable name="vDrop">
  15.           <xsl:apply-templates select="$pController">
  16.             <xsl:with-param name="pChar" select="substring($pStr, 1, 1)"/>
  17.             <xsl:with-param name="pParams" select="$pContollerParam"/>
  18.           </xsl:apply-templates>
  19.         </xsl:variable>
  20.         
  21.         <xsl:choose>
  22.         <xsl:when test="string($vDrop)">
  23.            <xsl:call-template name="str-dropWhile">
  24.               <xsl:with-param name="pStr" select="substring($pStr, 2)" />
  25.               <xsl:with-param name="pController" select="$pController"/>
  26.               <xsl:with-param name="pContollerParam" select="$pContollerParam"/>
  27.            </xsl:call-template>
  28.         </xsl:when>
  29.         <xsl:otherwise>
  30.           <xsl:copy-of select="$pStr"/>
  31.         </xsl:otherwise>
  32.         </xsl:choose>
  33.       
  34.       </xsl:if>
  35.   </xsl:template>
  36.  
  37. </xsl:stylesheet>