xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmars...@apache.org
Subject cvs commit: xml-xalan/test/tests/conf/variable variable54.xsl variable52.xsl variable53.xml variable53.xsl variable54.xml variable52.xml
Date Tue, 04 Sep 2001 18:05:09 GMT
dmarston    01/09/04 11:05:09

  Added:       test/tests/conf/variable variable54.xsl variable52.xsl
                        variable53.xml variable53.xsl variable54.xml
                        variable52.xml
  Log:
  New cases from John Howard.
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/variable/variable54.xsl
  
  Index: variable54.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- FileName: variable54 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.2 -->
    <!-- Author: John Howard -->
    <!-- Purpose: test using parameter names with '.' in them -->
   
  <xsl:output method="xml"/>
  
  <xsl:template match="/">
    <out>
      <xsl:call-template name="foo">
        <xsl:with-param name="foo.bar" select="/data/*/datum/@value"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="foo">
    <xsl:param name="foo.bar"/>
  
    <xsl:for-each select="$foo.bar">(<xsl:value-of select="position()"/>)</xsl:for-each>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/variable/variable52.xsl
  
  Index: variable52.xsl
  ===================================================================
  <?xml version='1.0' encoding='utf-8' ?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    version="1.0">
  
    <!-- FileName: variable52 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.6 -->
    <!-- Author: John Howard -->
    <!-- Purpose: test parameters call by reference and by value -->
   
  <xsl:output method="xml" indent="no"/>
  
  <xsl:template match="/">
    <out><xsl:text>&#10;</xsl:text>
      <xsl:variable name="foo" select="/data/point"/>
  
      <list m="ByReference">
        <xsl:call-template name="AllOrNothing">
          <xsl:with-param name="path" select="$foo"/>
        </xsl:call-template>
      </list><xsl:text>&#10;</xsl:text>
      <list m="ByValue">
        <xsl:call-template name="AllOrNothing">
          <xsl:with-param name="path" select="/data/point"/>
        </xsl:call-template>
      </list><xsl:text>&#10;</xsl:text>
      <list m="ByReference">
        <xsl:call-template name="AlmostAndNothing">
          <xsl:with-param name="path" select="$foo"/>
        </xsl:call-template>
      </list><xsl:text>&#10;</xsl:text>
      <list m="ByValue">
        <xsl:call-template name="AlmostAndNothing">
          <xsl:with-param name="path" select="/data/point"/>
        </xsl:call-template>
      </list><xsl:text>&#10;</xsl:text>
    </out>
  </xsl:template>
  
  <xsl:template name="AllOrNothing">
    <xsl:param name="path"/>
  
    <xsl:for-each select="/data/point">
      <xsl:variable name="pos" select="position()"/>
  
      <xsl:for-each select="$path[$pos]">
        <xsl:value-of select="."/><xsl:text>/</xsl:text>
      </xsl:for-each>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template name="AlmostAndNothing">
    <xsl:param name="path"/>
  
    <xsl:for-each select="$path">
      <xsl:variable name="pos" select="position()"/>
  
      <xsl:for-each select="$path[$pos]">
        <xsl:value-of select="."/><xsl:text>-</xsl:text>
      </xsl:for-each>
    </xsl:for-each>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/variable/variable53.xml
  
  Index: variable53.xml
  ===================================================================
  <?xml version="1.0"?>
  <data>
    <foodata>
      <datum value="a"/>
      <datum value="b"/>
      <datum value="c"/>
      <datum value="d"/>
    </foodata>
    <bardata>
      <datum value="k"/>
      <datum value="l"/>
      <datum value="m"/>
      <datum value="n"/>
    </bardata>
    <bazdata>
      <datum value="w"/>
      <datum value="x"/>
      <datum value="y"/>
      <datum value="z"/>
    </bazdata>
  </data>
  
  
  1.1                  xml-xalan/test/tests/conf/variable/variable53.xsl
  
  Index: variable53.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- FileName: variable53 -->
    <!-- Document: http://www.w3.org/TR/xslt -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 11.6 -->
    <!-- Author: John Howard -->
    <!-- Purpose: test using recursion to traverse a node-set in a variable. -->
   
  <xsl:output method="xml"/>
  
  <xsl:template match="/">
    <out>
      <xsl:call-template name="traverse-vals">
        <xsl:with-param name="pos" select="1"/>
      </xsl:call-template>
    </out>
  </xsl:template>
  
  <xsl:template name="traverse-vals">
    <xsl:param name="pos"/>
    <xsl:variable name="series" select="/data/*/datum/@value"/>
  
    <xsl:value-of select="concat($series[number($pos)],' ')"/>
    <xsl:if test="$pos &lt; count($series)">
      <xsl:call-template name="traverse-vals">
        <xsl:with-param name="pos" select="$pos + 1"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/variable/variable54.xml
  
  Index: variable54.xml
  ===================================================================
  <?xml version="1.0"?>
  <data>
    <foodata>
      <datum value="2"/>
      <datum value="3"/>
      <datum value="4"/>
    </foodata>
    <bardata>
      <datum value="6"/>
      <datum value="7"/>
      <datum value="8"/>
    </bardata>
  </data>
  
  
  1.1                  xml-xalan/test/tests/conf/variable/variable52.xml
  
  Index: variable52.xml
  ===================================================================
  <?xml version="1.0"?>
  <data>
    <point>10</point>
    <point>20</point>
    <point>30</point>
  </data>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message