[webkit-changes] cvs commit: LayoutTests/fast/xsl mozilla-tests-expected.txt mozilla-tests.xml mozilla-tests.xsl

Eric eseidel at opensource.apple.com
Thu Oct 13 16:51:02 PDT 2005


eseidel     05/10/13 16:51:01

  Added:       fast/js/resources xmlhttprequest-get-data.xml
               fast/xsl mozilla-tests-expected.txt mozilla-tests.xml
                        mozilla-tests.xsl
  Log:
  Bug #: none
  Submitted by: eseidel
  Reviewed by: mjs
          Adding a small xmlhttprequest test.
  
          * fast/js/resources/xmlhttprequest-get-data.xml: Added.
          * fast/js/xmlhttprequest-get-expected.txt: Added.
          * fast/js/xmlhttprequest-get.xhtml: Added.
  
  Revision  Changes    Path
  1.1                  LayoutTests/fast/js/resources/xmlhttprequest-get-data.xml
  
  Index: xmlhttprequest-get-data.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE doc [
  <!ATTLIST d id ID #IMPLIED>
  ]>
  <doc>
    <foo xmlns="foobar">One</foo> <x:bar xmlns:x="barfoo">Two</x:bar>
    <d id="id3">Three</d>
  </doc>
  
  
  
  
  1.1                  LayoutTests/fast/xsl/mozilla-tests-expected.txt
  
  Index: mozilla-tests-expected.txt
  ===================================================================
  Mozilla XSLT
  TransforMiiX Test Cases
  This document serves to test basic XSL expressions.
  
  Testing xsl:variable and xsl:copy-of
  Test: <xsl:copy-of select="$product-name"/>
  Desired Result:TransforMiiX
  Result: TransforMiiX
  
  Testing xsl:if
  Test: <xsl:if test="x | y | z">true</xsl:if>
  Desired Result: true
  Result:true
  
  Testing xsl:if
  Test: <xsl:if test="true()">true</xsl:if>
  Desired Result: true
  Result:true
  
  Testing xsl:if
  Test: <xsl:if test="'a'='b'">a equals b</xsl:if>
  <xsl:if test="'a'!='b'">a does not equal b</xsl:if> 
  Desired Result: a does not equal to b
  Result:a does not equal b
  
  Testing xsl:if
  Test: <xsl:if test="2+1-3"> 2+1-3 is true</xsl:if>
   <xsl:if test="not(2+1-3)"> not(2+1-3) is true</xsl:if>
  Desired Result:not(2+1-3) is true 
  Result:not(2+1-3) is true
  
  Testing xsl:choose
  Test:see source
  Desired Result: true
  Result:true
  
  Testing parent and ancestor ops
  Test:see source
  Desired Result: true
  Result:true
  
  Testing basic xsl:apply-templates
  Test:<xsl:apply-templates/>
  Desired Result:element x, element y, element z
  Result: element x, element y, element z
  
  Testing basic xsl:apply-templates with mode
  Test:<xsl:apply-templates mode="mode-test"/>
  Desired Result:x, y, z
  Result:x, y, z
  
  Testing predicates
  Test:see source
  Desired Result:z
  Result:z
  
  Testing predicates
  Test:see source
  Desired Result:
  Result:
  
  Named Template/Call Template
  
  Test:<xsl:call-template name="named-template-test"/>
  Desired Result:named template processed with default value!
  Result: named template processed with default value!
  
  Test: - passing arguments to named templates (see xsl source)
  Desired Result:named template processed with passed value!
  Result: named template processed with passed value! 
  Error, undeclared parameters should be ignored!
  
  Attribute Value Templates and variables
  Test:
  
  <xsl:variable name="color">red</xsl:variable>
  <FONT COLOR="{$color}">Red Text</FONT>
  Desired Result:Red Text
  Result:Red Text
  Axis Identifiers (these should work, I need more test cases though)
  Test:	 <xsl:if test="descendant::z">true</xsl:if>
  Desired Result:	true
  Result:	true
  Test:	 <xsl:if test="not(descendant-or-self::no-element)">true</xsl:if>
  Desired Result:	true
  Result:	true
  Test:	 <xsl:value-of select="count(x/attribute::*)"/>
  Desired Result:	1
  Result:	1
  Creating Elements with xsl:element and xsl:attribute
  Test:	 <xsl:element name="FONT">
  <xsl:attribute name="COLOR">blue</xsl:attribute> 
  Passed 
  </xsl:element>
  Desired Result:	Passed
  Result:	 Passed
  Using Attribute Sets
  Test:	 <FONT xsl:use-attribute-sets="style1">
  Passed 
  </FONT>
  Desired Result:	Passed
  Result:	 Passed
  Test:	 <xsl:element name="FONT" use-attribute-sets="style1 style2">
  Passed 
  </xsl:element>
  Desired Result:	Passed
  Result:	 Passed
  Numbering (only simple numbering currently implemented)
  Test:	 <xsl:number value="4"/>
  Desired Result:	4
  Result:	4
  Test:	 see source
  Desired Result:	 1. x 
  1. y
  1. z 
  Result:	1. x
  1. y
  1. z
  Additive Expressions
  Test:	 <xsl:value-of select="70+4"/>
  Desired Result:	74
  Result:	74
  Test:	 <xsl:value-of select="-70+4"/>
  Desired Result:	-66
  Result:	-66
  Test:	 <xsl:value-of select="1900+70+8-4"/>
  Desired Result:	1974
  Result:	1974
  Test:	 <xsl:value-of select="(4+5)-(9+9)"/>
  Desired Result:	-9
  Result:	-9
  Multiplicative Expressions
  Test:	 <xsl:value-of select="7*4"/>
  Desired Result:	28
  Result:	28
  Test:	 <xsl:value-of select="7mod 4"/>
  Desired Result:	3
  Result:	3
  Test:	 <xsl:value-of select="7div 4"/>
  Desired Result:	1.75
  Result:	1.75
  Test:	 <xsl:value-of select="7div 0"/>
  Desired Result:	Infinity
  Result:	Infinity
  Test:	 <xsl:value-of select="0 div 0"/>
  Desired Result:	NaN
  Result:	NaN
  Test:	 <xsl:variable name="x" select="7*3"/>
  <xsl:variable name="y" select="3"/>
  <xsl:value-of select="$x div $y"/>
  Desired Result:	7
  Result:	7
  Precedence tests
  Test:	 <xsl:value-of select="2 mod 2 = 0"/>
  Desired Result:	true
  Result:	true
  Test:	 <xsl:value-of select="5 mod 2 < 5 and 2*6 >= 12"/>
  Desired Result:	true
  Result:	true
  Test:	 <xsl:value-of select="5 mod 2 < 5 and 2*6>12"/>
  Desired Result:	false
  Result:	false
  Test:	 <xsl:value-of select="4+5*3"/>
  Desired Result:	19
  Result:	19
  Test:	 <xsl:value-of select="4+5*3+(6-4)*7"/>
  Desired Result:	33
  Result:	33
  Automatic Result Type Conversion
  Test:	 <xsl:value-of select="'747' + 8"/>
  Desired Result:	755
  Result:	755
  
  
  
  
  1.1                  LayoutTests/fast/xsl/mozilla-tests.xml
  
  Index: mozilla-tests.xml
  ===================================================================
  <?xml version="1.0"?>
  <?xml-stylesheet type="text/xsl" href="mozilla-tests.xsl"?>
  <!-- this is a test document -->
  <document>
     <!-- test comment -->
     <x name="x">x</x>
     <y name="y">y</y>
     <z name="z">z</z>
  
     <abc>
        <def>def</def>
     </abc>
  </document>
  
  
  
  1.1                  LayoutTests/fast/xsl/mozilla-tests.xsl
  
  Index: mozilla-tests.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!--
  /*
   * The contents of this file are subject to the Mozilla Public
   * License Version 1.1 (the "License"); you may not use this file
   * except in compliance with the License. You may obtain a copy of
   * the License at http://www.mozilla.org/MPL/
   *
   * Software distributed under the License is distributed on an "AS
   * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
   * implied. See the License for the specific language governing
   * rights and limitations under the License.
   *
   * The Original Code is XSL:P XSLT processor.
   *
   * The Initial Developer of the Original Code is Keith Visco.
   * Portions created by Keith Visco (C) 1999 Keith Visco.
   * All Rights Reserved..
   *
   * Contributor(s):
   * Keith Visco, kvisco at ziplink.net
   *    - original author.
   *
   */
  -->
  
  <!--
    This is a test stylesheet used for testing the XSL processor
  -->
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  <!-- set the output properties -->
  <xsl:output method="html"/>
  
  <!-- AttributeSet -->
  <xsl:attribute-set name="style1">
     <xsl:attribute name="COLOR">blue</xsl:attribute>
     <xsl:attribute name="SIZE">+0</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name="style2">
     <xsl:attribute name="COLOR">red</xsl:attribute>
     <xsl:attribute name="SIZE">+0</xsl:attribute>
  </xsl:attribute-set>
  
  <!-- root rule -->
  <xsl:template match="/">
     <xsl:processing-instruction name="foo">
        this is a test processing instruction
     </xsl:processing-instruction>
     <xsl:comment>TransforMiiX Test cases, written by Keith Visco.</xsl:comment>
     <xsl:apply-templates/>
  </xsl:template>
  
  <!-- named template -->
  <xsl:template name="named-template-test">
     <xsl:param name="my-param" select="'default value'"/>
     named template processed with <xsl:text> </xsl:text>
     <xsl:value-of select="$my-param"/>!
     <xsl:if test="$dummy-param">
       <BR/>
       <FONT COLOR="red">
          Error, undeclared parameters should be ignored!
       </FONT>
     </xsl:if>
  </xsl:template>
  
  <!-- empty variable for named template test -->
  <xsl:variable name="dummy-param" />
  
  <!-- supress non-selected nodes-->
  <xsl:template match="*"/>
  
  <!-- variable tests -->
  <xsl:variable name="product-name">
    Transfor<FONT COLOR="blue">Mii</FONT>X
  </xsl:variable>
  <!-- main rule for document element -->
  <xsl:template match="document">
  <HTML>
    <HEAD>
      <TITLE>TransforMiiX Test Cases</TITLE>
      <SCRIPT Language="JavaScript">
       <xsl:text>
        // Support for Apple's DumpRenderTree
          if (window.layoutTestController)
              layoutTestController.dumpAsText();
        // This is a test for properly printing SCRIPT elements
        // currently there is a bug, so use xsl:text as a wrapper as I
        // have done here
        function foo() {
            var x = 1;
            var y = 2;
            return (x &lt; y);
        }
       //
       </xsl:text>
      </SCRIPT>
    </HEAD>
    <BODY BGColor="#FFFFFF" Text="#000000">
    <CENTER>
        <FONT COLOR="BLUE" FACE="Arial" SIZE="+1">
           <B>Mozilla XSLT</B>
        </FONT>
        <BR/>
        <B>Transfor<FONT COLOR="blue">Mii</FONT>X Test Cases</B>
   </CENTER>
   <P>
    This document serves to test basic XSL expressions.
   </P>
   <!-- new test -->
   <P>
      <B>Testing xsl:variable and xsl:copy-of</B><BR/>
      <B>Test:</B> &lt;xsl:copy-of select="$product-name"/&gt;<BR/>
      <B>Desired Result:</B>Transfor<FONT COLOR="blue">Mii</FONT>X<BR/>
      <B>Result:</B><xsl:copy-of select="$product-name"/>
   </P>
   <!-- new test -->
   <P>
      <B>Testing xsl:if</B><BR/>
      <B>Test:</B> &lt;xsl:if test="x | y | z"&gt;true&lt;/xsl:if&gt;<BR/>
      <B>Desired Result:</B> true<BR/>
      <B>Result:</B> <xsl:if test="x | y | z">true</xsl:if>
   </P>
  
   <!-- new test -->
   <P>
      <B>Testing xsl:if</B><BR/>
      <B>Test:</B> &lt;xsl:if test="true()"&gt;true&lt;/xsl:if&gt;<BR/>
      <B>Desired Result:</B> true<BR/>
      <B>Result:</B> <xsl:if test="true()">true</xsl:if>
   </P>
  
   <!-- new test -->
   <P>
      <B>Testing xsl:if</B><BR/>
      <B>Test:</B> &lt;xsl:if test="'a'='b'"&gt;a equals b&lt;/xsl:if&gt;<BR/>
      <B></B> &lt;xsl:if test="'a'!='b'"&gt;a does not equal b&lt;/xsl:if&gt;
      <BR/>
      <B>Desired Result:</B> a does not equal to b<BR/>
      <B>Result:</B>
      <xsl:if test="'a'='b'">a equals b<BR/></xsl:if>
      <xsl:if test="'a'!='b'">a does not equal b</xsl:if>
   </P>
  
   <!-- new test -->
   <P>
      <B>Testing xsl:if</B><BR/>
      <B>Test:</B> &lt;xsl:if test="2+1-3"&gt; 2+1-3 is true&lt;/xsl:if&gt;<BR/>
      <B>&#160;</B>&lt;xsl:if test="not(2+1-3)"&gt; not(2+1-3) is true&lt;/xsl:if&gt;<BR/>
      <B>Desired Result:</B>not(2+1-3) is true <BR/>
      <B>Result:</B>
          <xsl:if test="2+1-3">2+1-3 is true</xsl:if>
          <xsl:if test="not(2+1-3)">not(2+1-3) is true</xsl:if>
   </P>
  
   <!-- new test -->
   <P>
      <B>Testing xsl:choose</B><BR/>
      <B>Test:</B>see source<BR/>
      <B>Desired Result:</B> true<BR/>
      <B>Result:</B>
      <xsl:choose>
          <xsl:when test="a">error - a</xsl:when>
          <xsl:when test="abc/def">true</xsl:when>
          <xsl:when test="b">error - b</xsl:when>
          <xsl:otherwise>false</xsl:otherwise>
      </xsl:choose>
   </P>
   <!-- new test -->
   <P>
      <B>Testing parent and ancestor ops</B><BR/>
      <B>Test:</B>see source<BR/>
      <B>Desired Result:</B> true<BR/>
      <B>Result:</B><xsl:if test="//def">true</xsl:if><BR/>
  
   </P>
   <!-- new test -->
  
    <P>
      <B>Testing basic xsl:apply-templates</B><BR/>
      <B>Test:</B>&lt;xsl:apply-templates/&gt;<BR/>
      <B>Desired Result:</B>element <B>x</B>, element <B>y</B>, element <B>z</B><BR/>
      <B>Result:</B><xsl:apply-templates select="x|y|z"/>
    </P>
   <!-- new test -->
  
    <P>
      <B>Testing basic xsl:apply-templates with mode</B><BR/>
      <B>Test:</B>&lt;xsl:apply-templates mode="mode-test"/&gt;<BR/>
      <B>Desired Result:</B>x, y, z<BR/>
      <B>Result:</B><xsl:apply-templates select="x|y|z" mode="mode-test"/>
    </P>
   <!-- new test -->
    <P>
      <B>Testing predicates</B><BR/>
      <B>Test:</B>see source<BR/>
      <B>Desired Result:</B> <B>z</B><BR/>
      <B>Result:</B>
      <xsl:for-each select="*[position()=3]">
        <B><xsl:value-of select="."/></B>
      </xsl:for-each>
    </P>
   <!-- new test -->
    <P>
      <B>Testing predicates</B><BR/>
      <B>Test:</B>see source<BR/>
      <B>Desired Result:</B><BR/>
      <B>Result:</B>
      <xsl:for-each select="*[false()]">
        <B><xsl:value-of select="."/></B>
      </xsl:for-each>
    </P>
   <!-- new test -->
    <P>
      <B>Named Template/Call Template</B>
      <P>
         <B>Test:</B>&lt;xsl:call-template name="named-template-test"/&gt;<BR/>
         <B>Desired Result:</B>named template processed with default value!<BR/>
         <B>Result:</B><xsl:call-template name="named-template-test"/>
      </P>
      <P>
         <B>Test:</B> - passing arguments to named templates (see xsl source)<BR/>
         <B>Desired Result:</B>named template processed with passed value!<BR/>
         <B>Result:</B>
             <xsl:call-template name="named-template-test">
                <xsl:with-param name="my-param" select="'passed value'"/>
                <xsl:with-param name="dummy-param" select="'test'"/>
             </xsl:call-template>
      </P>
    </P>
   <!-- new test -->
    <P>
      <B>Attribute Value Templates and variables</B><BR/>
      <B>Test:</B>
      <UL>
         &lt;xsl:variable name="color"&gt;red&lt;/xsl:variable&gt;<BR/>
         &lt;FONT COLOR="{$color}"&gt;Red Text&lt;/FONT&gt;
      </UL>
      <B>Desired Result:</B>
          <FONT COLOR="red">Red Text</FONT><BR/>
      <B>Result:</B>
         <xsl:variable name="color">red</xsl:variable>
         <FONT COLOR="{$color}">Red Text</FONT>
    </P>
    <HR/>
     <!-- AXIS IDENTIFIER TESTS -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Axis Identifiers (these should work, I need more test cases though)</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:if test="descendant::z"&gt;true&lt;/xsl:if&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">true</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <xsl:if test="descendant::z">
             <FONT COLOR="blue">true</FONT>
           </xsl:if>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:if test="not(descendant-or-self::no-element)"&gt;true&lt;/xsl:if&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">true</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <xsl:if test="not(descendant-or-self::no-element)">
             <FONT COLOR="blue">true</FONT>
           </xsl:if>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="count(x/attribute::*)"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">1</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue"><xsl:value-of select="count(x/attribute::*)"/></FONT>
        </TD>
     </TR>
     </TABLE>
  
    <HR/>
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Creating Elements with xsl:element and xsl:attribute</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:element name="FONT"&gt;<BR />
           &lt;xsl:attribute name="COLOR"&gt;blue&lt;/xsl:attribute&gt; <BR/>
           Passed <BR/>
           &lt;/xsl:element&gt;
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">Passed</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <xsl:element name="FONT">
             <xsl:attribute name="COLOR">blue</xsl:attribute>
             Passed
           </xsl:element>
        </TD>
     </TR>
     <!-- new test -->
     <TR BGCOLOR="#E0E0FF" ALIGN="CENTER">
        <TD COLSPAN="2"><B>Using Attribute Sets</B></TD>
     </TR>
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;FONT xsl:use-attribute-sets="style1"&gt;<BR />
           Passed <BR/>
           &lt;/FONT&gt;
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">Passed</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT xsl:use-attribute-sets="style1">
              Passed
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:element name="FONT" use-attribute-sets="style1 style2"&gt;<BR />
           Passed <BR/>
           &lt;/xsl:element&gt;
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="red">Passed</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <xsl:element name="FONT" use-attribute-sets="style1 style2">
              Passed
           </xsl:element>
        </TD>
     </TR>
     </TABLE>
     <HR/>
     <!-- NUMBERING Examples -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Numbering (only simple numbering currently implemented)</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:number value="4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">4</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue"><xsl:number value="4"/></FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           see source<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
             1. x <BR/>1. y<BR/>1. z
           </FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:for-each select="x | y | z">
                 <xsl:number/>
                 <xsl:text>. </xsl:text><xsl:value-of select="."/><BR/>
              </xsl:for-each>
           </FONT>
        </TD>
     </TR>
  
     </TABLE>
  
    <HR/>
    <!-- ADDITIVE EXPRESSION TESTS -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Additive Expressions</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="70+4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">74</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="70+4"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="-70+4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">-66</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="-70+4"/>
           </FONT>
        </TD>
     </TR>
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="1900+70+8-4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">1974</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="1900+70+8-4"/>
           </FONT>
        </TD>
     </TR>
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="(4+5)-(9+9)"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">-9</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="(4+5)-(9+9)"/>
           </FONT>
        </TD>
     </TR>
  
    </TABLE>
    <HR/>
    <!-- MULTIPLICATIVE EXPRESSION TESTS -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Multiplicative Expressions</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="7*4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">28</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="7*4"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="7mod 4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">3</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="7mod 4"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="7div 4"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">1.75</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="7div 4"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="7div 0"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">Infinity</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="7div 0"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="0 div 0"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">NaN</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="0 div 0"/>
           </FONT>
        </TD>
     </TR>
  
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:variable name="x" select="7*3"/&gt;<BR />
           &lt;xsl:variable name="y" select="3"/&gt;<BR />
           &lt;xsl:value-of select="$x div $y"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">7</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:variable name="x" select="7*3"/>
              <xsl:variable name="y" select="3"/>
              <xsl:value-of select="$x div $y"/>
              <BR/>
  
           </FONT>
        </TD>
     </TR>
     </TABLE>
    <!-- PRECEDENCE TESTS -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Precedence tests</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="2 mod 2 = 0"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">true</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="2 mod 2 = 0"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="5 mod 2 &lt; 5 and 2*6 &gt;= 12"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">true</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="5 mod 2 &lt; 5 and 2*6>=12"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="5 mod 2 &lt; 5 and 2*6>12"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">false</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="5 mod 2 &lt; 5 and 2*6>12"/>
           </FONT>
        </TD>
     </TR>
  
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="4+5*3"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">19</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="4+5*3"/>
           </FONT>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="4+5*3+(6-4)*7"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">33</FONT><BR/>
        </TD>
      </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="4+5*3+(6-4)*7"/>
           </FONT>
        </TD>
     </TR>
     </TABLE>
  
    <!-- Result Type conversion tests -->
     <TABLE>
     <TR BGColor="#E0E0FF">
        <TD Colspan="2" ALIGN="CENTER">
           <B>Automatic Result Type Conversion</B>
        </TD>
     </TR>
     <!-- new test -->
     <TR>
        <TD VALIGN="TOP"><B>Test:</B></TD>
        <TD>
           &lt;xsl:value-of select="'747' + 8"/&gt;<BR />
        </TD>
     </TR>
     <TR>
        <TD><B>Desired Result:</B></TD>
        <TD>
           <FONT COLOR="blue">755</FONT><BR/>
        </TD>
     </TR>
      <TR>
        <TD><B>Result:</B></TD>
        <TD>
           <FONT COLOR="blue">
              <xsl:value-of select="'747' + 8"/>
           </FONT>
        </TD>
     </TR>
     </TABLE>
    </BODY>
  </HTML>
  </xsl:template>
  
  <!-- simple union expressions -->
  <xsl:template match="x | y | z" priority="1.0">
     element<B><xsl:text> </xsl:text><xsl:value-of select="@*"/></B>
     <xsl:if test="not(position()=3)">,</xsl:if>
  </xsl:template>
  
  <xsl:template match="x | y | z" mode="mode-test">
     <xsl:value-of select="@*"/>
     <xsl:if test="not(position()=3)"><xsl:text>, </xsl:text></xsl:if>
  </xsl:template>
  
  <xsl:template match="z">
     element (z): <B><xsl:value-of select="."/></B>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  



More information about the webkit-changes mailing list