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 / F33080_testStore.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  4.0 KB  |  95 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. >
  4.  
  5.   <xsl:import href="store.xsl"/>
  6.   
  7.   <!-- to be applied on any xml source -->
  8.   
  9.   <xsl:output method="text"/>  
  10.  
  11.   <xsl:template match="/"> 
  12.     
  13.     <!-- Get Initial Store -->
  14.     <xsl:variable name="vrtfStore0">
  15.       <xsl:call-template name="getInitialStore"/>
  16.     </xsl:variable>
  17.     
  18.     <xsl:variable name="vStore0" select="msxsl:node-set($vrtfStore0)/*"/>
  19.     
  20.     <!-- Get A, B, C from the initial store: must be 0-s -->
  21.       vStore0:
  22.       A='<xsl:apply-templates select="$vStore0/*[local-name() = 'getValue']">
  23.           <xsl:with-param name="pName" select="'A'"/>
  24.          </xsl:apply-templates>'
  25.       B='<xsl:apply-templates select="$vStore0/*[local-name() = 'getValue']">
  26.           <xsl:with-param name="pName" select="'B'"/>
  27.          </xsl:apply-templates>'
  28.       C='<xsl:apply-templates select="$vStore0/*[local-name() = 'getValue']">
  29.           <xsl:with-param name="pName" select="'C'"/>
  30.          </xsl:apply-templates>'
  31.  
  32.     <!-- Update store0 with 'A=1' -->
  33.     <xsl:variable name="vrtfStore1">
  34.       <xsl:apply-templates select="$vStore0/*[local-name() = 'updateStore']">
  35.         <xsl:with-param name="pName" select="'A'"/>
  36.         <xsl:with-param name="pValue" select="1"/>
  37.       </xsl:apply-templates>
  38.     </xsl:variable>
  39.  
  40.     <xsl:variable name="vStore1" select="msxsl:node-set($vrtfStore1)/*"/>
  41.     <!-- Get A, B, C from the store1: A is 1, the rest must be 0-s -->
  42.       vStore1:
  43.       A='<xsl:apply-templates select="$vStore1/*[local-name() = 'getValue']">
  44.           <xsl:with-param name="pName" select="'A'"/>
  45.          </xsl:apply-templates>'
  46.       B='<xsl:apply-templates select="$vStore1/*[local-name() = 'getValue']">
  47.            <xsl:with-param name="pName" select="'B'"/>
  48.          </xsl:apply-templates>'
  49.       C='<xsl:apply-templates select="$vStore1/*[local-name() = 'getValue']">
  50.            <xsl:with-param name="pName" select="'C'"/>
  51.          </xsl:apply-templates>'
  52.     
  53.     <!-- Update store1 with 'B=2' -->
  54.     <xsl:variable name="vrtfStore2">
  55.       <xsl:apply-templates select="$vStore1/*[local-name() = 'updateStore']">
  56.         <xsl:with-param name="pName" select="'B'"/>
  57.         <xsl:with-param name="pValue" select="2"/>
  58.       </xsl:apply-templates>
  59.     </xsl:variable>
  60.  
  61.     <xsl:variable name="vStore2" select="msxsl:node-set($vrtfStore2)/*"/>
  62.     <!-- Get A, B, C from the store2: A is 1, B is 2, the rest must be 0-s -->
  63.       vStore2:
  64.       A='<xsl:apply-templates select="$vStore2/*[local-name() = 'getValue']">
  65.            <xsl:with-param name="pName" select="'A'"/>
  66.          </xsl:apply-templates>'
  67.       B='<xsl:apply-templates select="$vStore2/*[local-name() = 'getValue']">
  68.            <xsl:with-param name="pName" select="'B'"/>
  69.          </xsl:apply-templates>'
  70.       C='<xsl:apply-templates select="$vStore2/*[local-name() = 'getValue']">
  71.            <xsl:with-param name="pName" select="'C'"/>
  72.          </xsl:apply-templates>'
  73.     
  74.     <!-- Update store2 with 'C=3' -->
  75.     <xsl:variable name="vrtfStore3">
  76.       <xsl:apply-templates select="$vStore2/*[local-name() = 'updateStore']">
  77.         <xsl:with-param name="pName" select="'C'"/>
  78.         <xsl:with-param name="pValue" select="3"/>
  79.       </xsl:apply-templates>
  80.     </xsl:variable>
  81.  
  82.     <xsl:variable name="vStore3" select="msxsl:node-set($vrtfStore3)/*"/>
  83.     <!-- Get A, B, C from the store3: A is 1, B is 2, C is 3, the rest must be 0-s -->
  84.       vStore3:
  85.       A='<xsl:apply-templates select="$vStore3/*[local-name() = 'getValue']">
  86.            <xsl:with-param name="pName" select="'A'"/>
  87.          </xsl:apply-templates>'
  88.       B='<xsl:apply-templates select="$vStore3/*[local-name() = 'getValue']">
  89.            <xsl:with-param name="pName" select="'B'"/>
  90.          </xsl:apply-templates>'
  91.       C='<xsl:apply-templates select="$vStore3/*[local-name() = 'getValue']">
  92.            <xsl:with-param name="pName" select="'C'"/>
  93.          </xsl:apply-templates>'
  94.    </xsl:template>
  95. </xsl:stylesheet>