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 / F41296_store2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  1.4 KB  |  50 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:getInitialStore="f:getInitialStore"
  3. xmlns:getValue="f:getValue0"
  4. xmlns:upd-getValue="f:upd-getValue"
  5. xmlns:updateStore="f:updateStore"
  6. >
  7.   
  8.   
  9.   <xsl:template name="getInitialStore" match="getInitialStore:*">
  10.     <store>
  11.       <getInitialStore:getInitialStore/>
  12.       <getValue:getValue/>
  13.       <updateStore:updateStore/>
  14.     </store>
  15.   </xsl:template>
  16.   
  17.   <xsl:template match="getValue:*">
  18.      <xsl:value-of select="0"/>
  19.   </xsl:template>
  20.   
  21.   <xsl:template match="updateStore:*">
  22.     <xsl:param name="pName"/>
  23.     <xsl:param name="pValue"/>
  24.     
  25.     <store>
  26.       <getInitialStore:getInitialStore/>
  27.       <upd-getValue:getValue>
  28.         <store><xsl:copy-of select="../*"/></store>
  29.         <name><xsl:value-of select="$pName"/></name>
  30.         <value><xsl:value-of select="$pValue"/></value>
  31.       </upd-getValue:getValue> 
  32.       <updateStore:updateStore/>
  33.     </store>
  34.   </xsl:template>
  35.   
  36.   <xsl:template match="upd-getValue:*">
  37.     <xsl:param name="pName"/>
  38.     
  39.     <xsl:choose>
  40.       <xsl:when test="$pName = name">
  41.         <xsl:value-of select="value"/>
  42.       </xsl:when>
  43.       <xsl:otherwise>
  44.         <xsl:apply-templates select="store/*[local-name()='getValue']">
  45.            <xsl:with-param name="pName" select="$pName"/>
  46.         </xsl:apply-templates>
  47.       </xsl:otherwise>
  48.     </xsl:choose>
  49.   </xsl:template>
  50. </xsl:stylesheet>