added some new tests concerning variable declarations inside variables

This commit is contained in:
jez 2008-08-05 16:17:28 +01:00
parent 538fe00271
commit 01db7aad46
14 changed files with 141 additions and 4 deletions

View file

@ -37,7 +37,7 @@ const char* msft_tests[] = { "AVTs", /*"AttributeSets",*/ "Attributes", "BVTs",
/*"Stylesheet", */ /*"Template",*/ /*"Text", */ /*"ValueOf",*/
"Variables", "Whitespaces", "XSLTFunctions", 0 };
const char* arabica_tests[] = { "errors", "include", "processing-instruction", "stylesheet", 0 };
const char* arabica_tests[] = { "errors", "include", "processing-instruction", "stylesheet", "variables", 0 };
int main(int argc, const char* argv[])
{

View file

@ -126,5 +126,39 @@
<output-file role="principal">stylesheet03.out</output-file>
</scenario>
</test-case>
</test-catalog>
<test-case id="variables01">
<file-path>variables</file-path>
<purpose>Use xsl:variable within xsl:variable with a variable of the same name. Also, a global variable exist (with the same name as well). Adapted from MS test case</purpose>
<scenario operation="standard">
<input-file role="principal-data">VariableWithinVariable.xml</input-file>
<input-file role="principal-stylesheet">VariableWithinVariable.xsl</input-file>
<output-file role="principal">VariableWithinVariable_result.xml</output-file>
</scenario>
</test-case>
<test-case id="variables02">
<file-path>variables</file-path>
<purpose>Use xsl:variable within xsl:variable </purpose>
<scenario operation="execution-error">
<input-file role="principal-data">VariableWithinVariable2.xml</input-file>
<input-file role="principal-stylesheet">VariableWithinVariable2.xsl</input-file>
</scenario>
</test-case>
<test-case id="variables03">
<file-path>variables</file-path>
<purpose>Use xsl:variable within xsl:variable </purpose>
<scenario operation="standard">
<input-file role="principal-data">VariableWithinVariable3.xml</input-file>
<input-file role="principal-stylesheet">VariableWithinVariable3.xsl</input-file>
<output-file role="principal">VariableWithinVariable3_result.xml</output-file>
</scenario>
</test-case>
<test-case id="variables04">
<file-path>variables</file-path>
<purpose>Use xsl:variable within xsl:variable </purpose>
<scenario operation="execution-error">
<input-file role="principal-data">VariableWithinVariable4.xml</input-file>
<input-file role="principal-stylesheet">VariableWithinVariable4.xsl</input-file>
</scenario>
</test-case>
</test-catalog>
</test-suite>

View file

@ -630,7 +630,7 @@
<test-case id="Variables_PositionAndLastComparisonShouldBeEqual" compare="text"/>
<test-case id="Variables_SelectAttributeAndWhitespaceBetweenElement" compare="fragment"/>
<test-case id="Variables_UseDocumentFnToReturnRootNode" compare="text"/>
<test-case id="Variables_VariableWithinVariable" compare="text"/>
<test-case id="Variables_VariableWithinVariable" skip="yes" reason="XML encoding in Windows-1251. Similar test in arabica tests."/>
<test-case id="Variables_xslt_variable_qname_test1" compare="fragment"/>
<test-case id="Variables_xslt_variable_qname_test2" compare="fragment"/>

View file

@ -0,0 +1 @@
<root>local from global</root>

View file

@ -0,0 +1 @@
<root>local from global</root>

View file

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<book>
<author>Joseph Smith</author>
<title />
</book>

View file

@ -0,0 +1,20 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:variable name="foo" select="'global'"/>
<xsl:template match="/">
<xsl:variable name="foo">
<xsl:variable name="foo" select="concat('local from ', $foo)"/>
<xsl:value-of select="$foo"/>
</xsl:variable>
<root>
<xsl:value-of select="$foo"/>
</root>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<book>
<author>Joseph Smith</author>
<title />
</book>

View file

@ -0,0 +1,21 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:variable name="foo" select="'global'"/>
<xsl:template match="/">
<xsl:variable name="bar" select="'baz'"/>
<xsl:variable name="foo">
<xsl:variable name="bar" select="concat('local from ', $foo)"/>
<xsl:value-of select="$bar"/>
</xsl:variable>
<root>
<xsl:value-of select="$foo"/>
</root>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<book>
<author>Joseph Smith</author>
<title />
</book>

View file

@ -0,0 +1,20 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:variable name="foo" select="'global'"/>
<xsl:template match="/">
<xsl:variable name="bar">
<xsl:variable name="foo" select="concat('local from ', $foo)"/>
<xsl:value-of select="$foo"/>
</xsl:variable>
<root>
<xsl:value-of select="$bar"/>
</root>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<book>
<author>Joseph Smith</author>
<title />
</book>

View file

@ -0,0 +1,20 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:variable name="foo" select="'global'"/>
<xsl:template match="/">
<xsl:variable name="foo">
<xsl:variable name="bar" select="concat('local from ', $foo)"/>
<xsl:value-of select="$bar"/>
</xsl:variable>
<root>
<xsl:value-of select="$foo"/>,<xsl:value-of select="$bar"/>
</root>
</xsl:template>
</xsl:stylesheet>

View file

@ -912,7 +912,7 @@
>
<Tool
Name="VCCustomBuildTool"
CommandLine="cl /TC /EP -D USE_MSXML ..\vs7\ArabicaConfig.S &gt; ..\include\SAX\ArabicaConfig.hpp&#x0D;&#x0A;"
CommandLine="cl /TC /EP -D USE_EXPAT ..\vs7\ArabicaConfig.S &gt; ..\include\SAX\ArabicaConfig.hpp&#x0D;&#x0A;"
Outputs="..\include\SAX\ArabicaConfig.hpp"
/>
</FileConfiguration>