2 TransforMiiX Test Cases
3 This document serves to test basic XSL expressions.
5 Testing xsl:variable and xsl:copy-of
6 Test: <xsl:copy-of select="$product-name"/>
7 Desired Result:TransforMiiX
11 Test: <xsl:if test="x | y | z">true</xsl:if>
16 Test: <xsl:if test="true()">true</xsl:if>
21 Test: <xsl:if test="'a'='b'">a equals b</xsl:if>
22 <xsl:if test="'a'!='b'">a does not equal b</xsl:if>
23 Desired Result: a does not equal to b
24 Result:a does not equal b
27 Test: <xsl:if test="2+1-3"> 2+1-3 is true</xsl:if>
28 <xsl:if test="not(2+1-3)"> not(2+1-3) is true</xsl:if>
29 Desired Result:not(2+1-3) is true
30 Result:not(2+1-3) is true
37 Testing parent and ancestor ops
41 Testing basic xsl:apply-templates
42 Test:<xsl:apply-templates/>
43 Desired Result:element x, element y, element z
44 Result: element x, element y, element z
46 Testing basic xsl:apply-templates with mode
47 Test:<xsl:apply-templates mode="mode-test"/>
48 Desired Result:x, y, z
61 Named Template/Call Template
63 Test:<xsl:call-template name="named-template-test"/>
64 Desired Result:named template processed with default value!
65 Result: named template processed with default value!
67 Test: - passing arguments to named templates (see xsl source)
68 Desired Result:named template processed with passed value!
69 Result: named template processed with passed value!
71 Attribute Value Templates and variables
74 <xsl:variable name="color">red</xsl:variable>
75 <FONT COLOR="{$color}">Red Text</FONT>
76 Desired Result:Red Text
78 Axis Identifiers (these should work, I need more test cases though)
79 Test: <xsl:if test="descendant::z">true</xsl:if>
82 Test: <xsl:if test="not(descendant-or-self::no-element)">true</xsl:if>
85 Test: <xsl:value-of select="count(x/attribute::*)"/>
88 Creating Elements with xsl:element and xsl:attribute
89 Test: <xsl:element name="FONT">
90 <xsl:attribute name="COLOR">blue</xsl:attribute>
93 Desired Result: Passed
96 Test: <FONT xsl:use-attribute-sets="style1">
99 Desired Result: Passed
101 Test: <xsl:element name="FONT" use-attribute-sets="style1 style2">
104 Desired Result: Passed
106 Numbering (only simple numbering currently implemented)
107 Test: <xsl:number value="4"/>
118 Test: <xsl:value-of select="70+4"/>
121 Test: <xsl:value-of select="-70+4"/>
124 Test: <xsl:value-of select="1900+70+8-4"/>
127 Test: <xsl:value-of select="(4+5)-(9+9)"/>
130 Multiplicative Expressions
131 Test: <xsl:value-of select="7*4"/>
134 Test: <xsl:value-of select="7mod 4"/>
137 Test: <xsl:value-of select="7div 4"/>
140 Test: <xsl:value-of select="7div 0"/>
141 Desired Result: Infinity
143 Test: <xsl:value-of select="0 div 0"/>
146 Test: <xsl:variable name="x" select="7*3"/>
147 <xsl:variable name="y" select="3"/>
148 <xsl:value-of select="$x div $y"/>
152 Test: <xsl:value-of select="2 mod 2 = 0"/>
155 Test: <xsl:value-of select="5 mod 2 < 5 and 2*6 >= 12"/>
158 Test: <xsl:value-of select="5 mod 2 < 5 and 2*6>12"/>
159 Desired Result: false
161 Test: <xsl:value-of select="4+5*3"/>
164 Test: <xsl:value-of select="4+5*3+(6-4)*7"/>
167 Automatic Result Type Conversion
168 Test: <xsl:value-of select="'747' + 8"/>