From 01db7aad4628cdab7d0cdac39cc1124c4b1d228e Mon Sep 17 00:00:00 2001 From: jez Date: Tue, 5 Aug 2008 16:17:28 +0100 Subject: [PATCH] added some new tests concerning variable declarations inside variables --- tests/XSLT/main.cpp | 2 +- .../XSLT/testsuite/TESTS/arabica-catalog.xml | 36 ++++++++++++++++++- .../TESTS/arabica-expected-fails.xml | 2 +- .../VariableWithinVariable3_result.xml | 1 + .../VariableWithinVariable_result.xml | 1 + .../variables/VariableWithinVariable.xml | 5 +++ .../variables/VariableWithinVariable.xsl | 20 +++++++++++ .../variables/VariableWithinVariable2.xml | 5 +++ .../variables/VariableWithinVariable2.xsl | 21 +++++++++++ .../variables/VariableWithinVariable3.xml | 5 +++ .../variables/VariableWithinVariable3.xsl | 20 +++++++++++ .../variables/VariableWithinVariable4.xml | 5 +++ .../variables/VariableWithinVariable4.xsl | 20 +++++++++++ vs9/lib_arabica.vcproj | 2 +- 14 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable3_result.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable_result.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xsl diff --git a/tests/XSLT/main.cpp b/tests/XSLT/main.cpp index 8bbad015..c1a103e8 100755 --- a/tests/XSLT/main.cpp +++ b/tests/XSLT/main.cpp @@ -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[]) { diff --git a/tests/XSLT/testsuite/TESTS/arabica-catalog.xml b/tests/XSLT/testsuite/TESTS/arabica-catalog.xml index 1b42c08b..60094062 100755 --- a/tests/XSLT/testsuite/TESTS/arabica-catalog.xml +++ b/tests/XSLT/testsuite/TESTS/arabica-catalog.xml @@ -126,5 +126,39 @@ stylesheet03.out - + + variables + 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 + + VariableWithinVariable.xml + VariableWithinVariable.xsl + VariableWithinVariable_result.xml + + + + variables + Use xsl:variable within xsl:variable + + VariableWithinVariable2.xml + VariableWithinVariable2.xsl + + + + variables + Use xsl:variable within xsl:variable + + VariableWithinVariable3.xml + VariableWithinVariable3.xsl + VariableWithinVariable3_result.xml + + + + variables + Use xsl:variable within xsl:variable + + VariableWithinVariable4.xml + VariableWithinVariable4.xsl + + + diff --git a/tests/XSLT/testsuite/TESTS/arabica-expected-fails.xml b/tests/XSLT/testsuite/TESTS/arabica-expected-fails.xml index 60995d2e..e772b0fb 100644 --- a/tests/XSLT/testsuite/TESTS/arabica-expected-fails.xml +++ b/tests/XSLT/testsuite/TESTS/arabica-expected-fails.xml @@ -630,7 +630,7 @@ - + diff --git a/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable3_result.xml b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable3_result.xml new file mode 100644 index 00000000..b84ec2f1 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable3_result.xml @@ -0,0 +1 @@ +local from global \ No newline at end of file diff --git a/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable_result.xml b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable_result.xml new file mode 100644 index 00000000..b84ec2f1 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/VariableWithinVariable_result.xml @@ -0,0 +1 @@ +local from global \ No newline at end of file diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xml b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xml new file mode 100644 index 00000000..48479d98 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xml @@ -0,0 +1,5 @@ + + + Joseph Smith + +</book> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xsl new file mode 100644 index 00000000..780299b6 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable.xsl @@ -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> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xml b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xml new file mode 100644 index 00000000..48479d98 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xml @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<book> + <author>Joseph Smith</author> + <title /> +</book> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xsl new file mode 100644 index 00000000..bbe656e0 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable2.xsl @@ -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> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xml b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xml new file mode 100644 index 00000000..48479d98 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xml @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<book> + <author>Joseph Smith</author> + <title /> +</book> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xsl new file mode 100644 index 00000000..5a3c1db6 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable3.xsl @@ -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> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xml b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xml new file mode 100644 index 00000000..48479d98 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xml @@ -0,0 +1,5 @@ +<?xml version="1.0"?> +<book> + <author>Joseph Smith</author> + <title /> +</book> diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xsl new file mode 100644 index 00000000..1334e33c --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/VariableWithinVariable4.xsl @@ -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> diff --git a/vs9/lib_arabica.vcproj b/vs9/lib_arabica.vcproj index 64465f5e..ced6925f 100644 --- a/vs9/lib_arabica.vcproj +++ b/vs9/lib_arabica.vcproj @@ -912,7 +912,7 @@ > <Tool Name="VCCustomBuildTool" - CommandLine="cl /TC /EP -D USE_MSXML ..\vs7\ArabicaConfig.S > ..\include\SAX\ArabicaConfig.hpp " + CommandLine="cl /TC /EP -D USE_EXPAT ..\vs7\ArabicaConfig.S > ..\include\SAX\ArabicaConfig.hpp " Outputs="..\include\SAX\ArabicaConfig.hpp" /> </FileConfiguration>