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 / F35958_store2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-11-25  |  1.5 KB  |  51 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:getInitialStore="f:getInitialStore"
  4. xmlns:getValue="f:getValue0"
  5. xmlns:upd-getValue="f:upd-getValue"
  6. xmlns:updateStore="f:updateStore"
  7. >
  8.   
  9.   
  10.   <xsl:template name="getInitialStore" match="getInitialStore:*">
  11.     <store>
  12.       <getInitialStore:getInitialStore/>
  13.       <getValue:getValue/>
  14.       <updateStore:updateStore/>
  15.     </store>
  16.   </xsl:template>
  17.   
  18.   <xsl:template match="getValue:*">
  19.      <xsl:value-of select="0"/>
  20.   </xsl:template>
  21.   
  22.   <xsl:template match="updateStore:*">
  23.     <xsl:param name="pName"/>
  24.     <xsl:param name="pValue"/>
  25.     
  26.     <store>
  27.       <getInitialStore:getInitialStore/>
  28.       <upd-getValue:getValue>
  29.         <store><xsl:copy-of select="../*"/></store>
  30.         <name><xsl:value-of select="$pName"/></name>
  31.         <value><xsl:value-of select="$pValue"/></value>
  32.       </upd-getValue:getValue> 
  33.       <updateStore:updateStore/>
  34.     </store>
  35.   </xsl:template>
  36.   
  37.   <xsl:template match="upd-getValue:*">
  38.     <xsl:param name="pName"/>
  39.     
  40.     <xsl:choose>
  41.       <xsl:when test="$pName = name">
  42.         <xsl:value-of select="value"/>
  43.       </xsl:when>
  44.       <xsl:otherwise>
  45.         <xsl:apply-templates select="store/*[local-name()='getValue']">
  46.            <xsl:with-param name="pName" select="$pName"/>
  47.         </xsl:apply-templates>
  48.       </xsl:otherwise>
  49.     </xsl:choose>
  50.   </xsl:template>
  51. </xsl:stylesheet>