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 / F30980_take.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  2.1 KB  |  52 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
  3. xmlns:take-controller="take-controller"
  4. xmlns:take-dynamic-controller="take-dynamic-controller"
  5. exclude-result-prefixes="xsl msxsl"
  6. >
  7.   <xsl:import href="buildListWhile.xsl"/>
  8.   <take-controller:take-controller/>
  9.   <take-dynamic-controller:take-dynamic-controller/>
  10.  
  11.   <xsl:template name="take">
  12.     <xsl:param name="pList" select="/.."/>
  13.     <xsl:param name="pN" select="0"/>
  14.     <xsl:param name="pGenerator" select="/.."/>
  15.     <xsl:param name="pParam0" select="/.."/>
  16.     <xsl:param name="pParamGenerator" select="/.."/>
  17.     <xsl:param name="pElementName" select="'el'"/>
  18.     
  19.     <xsl:variable name="vTakeController" select="document('')/*/take-controller:*[1]"/>
  20.     <xsl:variable name="vTakeDynController" select="document('')/*/take-dynamic-controller:*[1]"/>
  21.  
  22.     <xsl:choose>
  23.       <xsl:when test="$pList">
  24.         <xsl:copy-of select="$pList[position() <= $pN]"/>
  25.       </xsl:when>
  26.       <xsl:when test="$pGenerator">
  27.           <xsl:call-template name="buildListWhile">
  28.                 <xsl:with-param name="pList" select="/.."/>
  29.                 <xsl:with-param name="pGenerator" select="$pGenerator"/>
  30.                 <xsl:with-param name="pController" select="$vTakeDynController"/>
  31.                 <xsl:with-param name="pContollerParam" select="$pN"/>
  32.                 <xsl:with-param name="pParam0" select="$pParam0"/>
  33.                 <xsl:with-param name="pParamGenerator" select="$pParamGenerator"/>
  34.                 <xsl:with-param name="pElementName" select="$pElementName"/>
  35.           </xsl:call-template>
  36.       </xsl:when>
  37.     </xsl:choose>
  38.   </xsl:template>
  39.  
  40.   <xsl:template name="takeController" match="*[namespace-uri()='take-controller']">
  41.      <xsl:param name="pParams"/>
  42.      
  43.      <xsl:if test="$pParams > 0">1</xsl:if>
  44.   </xsl:template>
  45.   
  46.   <xsl:template name="takeDynController" match="*[namespace-uri()='take-dynamic-controller']">
  47.      <xsl:param name="pList"/>
  48.      <xsl:param name="pParams"/>
  49.      
  50.      <xsl:if test="$pParams >= count($pList)">1</xsl:if>
  51.   </xsl:template>
  52. </xsl:stylesheet>