From 72e8decc76aabf6f3ea724ffd54c58a2a7647cc4 Mon Sep 17 00:00:00 2001 From: jez Date: Tue, 5 Aug 2008 20:35:28 +0100 Subject: [PATCH] added some precedence tests --- include/XSLT/impl/xslt_stylesheet.hpp | 6 +++--- tests/XSLT/testsuite/TESTS/arabica-catalog.xml | 18 ++++++++++++++++++ .../variables/import_precedence2_result.xml | 1 + .../variables/import_precedence_result.xml | 1 + .../testsuite/TESTS/arabica/variables/foo.xml | 1 + .../arabica/variables/import_precedence.xsl | 14 ++++++++++++++ .../arabica/variables/import_precedence2.xsl | 13 +++++++++++++ .../arabica/variables/import_precedence_a.xsl | 7 +++++++ .../arabica/variables/import_precedence_b.xsl | 9 +++++++++ 9 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence2_result.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence_result.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/foo.xml create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence2.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_a.xsl create mode 100644 tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_b.xsl diff --git a/include/XSLT/impl/xslt_stylesheet.hpp b/include/XSLT/impl/xslt_stylesheet.hpp index 338d6462..0cb96fa6 100755 --- a/include/XSLT/impl/xslt_stylesheet.hpp +++ b/include/XSLT/impl/xslt_stylesheet.hpp @@ -78,11 +78,11 @@ public: for(boost::ptr_vector::const_iterator pi = params_.begin(), pe = params_.end(); pi != pe; ++pi) pi->declare(context); for(ItemStack::const_iterator isi = items_.begin(), ise = items_.end(); isi != ise; ++isi) + { for(ItemList::const_iterator ci = isi->begin(), ce = isi->end(); ci != ce; ++ci) - { (*ci)->execute(initialNode, context); - context.pushVariablePrecendence(); - } // for ... + context.pushVariablePrecendence(); + } // for ... context.freezeTopLevel(); // go! diff --git a/tests/XSLT/testsuite/TESTS/arabica-catalog.xml b/tests/XSLT/testsuite/TESTS/arabica-catalog.xml index 60094062..6ef60d52 100755 --- a/tests/XSLT/testsuite/TESTS/arabica-catalog.xml +++ b/tests/XSLT/testsuite/TESTS/arabica-catalog.xml @@ -160,5 +160,23 @@ VariableWithinVariable4.xsl + + variables + import precedence + + foo.xml + import_precedence.xsl + import_precedence_result.xml + + + + variables + import precedence + + foo.xml + import_precedence2.xsl + import_precedence2_result.xml + + diff --git a/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence2_result.xml b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence2_result.xml new file mode 100644 index 00000000..322ada83 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence2_result.xml @@ -0,0 +1 @@ +var(foo3) diff --git a/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence_result.xml b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence_result.xml new file mode 100644 index 00000000..9dc40375 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/REF_OUT/variables/import_precedence_result.xml @@ -0,0 +1 @@ +var(foo) diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/foo.xml b/tests/XSLT/testsuite/TESTS/arabica/variables/foo.xml new file mode 100644 index 00000000..9a0afb43 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/foo.xml @@ -0,0 +1 @@ + diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence.xsl new file mode 100644 index 00000000..da9f9d41 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence.xsl @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence2.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence2.xsl new file mode 100644 index 00000000..303fd465 --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence2.xsl @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_a.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_a.xsl new file mode 100644 index 00000000..c55493fe --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_a.xsl @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_b.xsl b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_b.xsl new file mode 100644 index 00000000..e1baabaf --- /dev/null +++ b/tests/XSLT/testsuite/TESTS/arabica/variables/import_precedence_b.xsl @@ -0,0 +1,9 @@ + + + + + + + + +