simple-xspec-wrapper 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +11 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +37 -0
- data/LICENSE.txt +21 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/xspec +16 -0
- data/lib/xspec/version.rb +3 -0
- data/lib/xspec.rb +256 -0
- data/simple-xspec-wrapper.gemspec +28 -0
- data/spec-test.xml +1125 -0
- data/vendor/xspec-1.0.0/.gitignore +7 -0
- data/vendor/xspec-1.0.0/.travis.yml +57 -0
- data/vendor/xspec-1.0.0/LICENSE +21 -0
- data/vendor/xspec-1.0.0/README.md +26 -0
- data/vendor/xspec-1.0.0/appveyor.yml +77 -0
- data/vendor/xspec-1.0.0/bin/xspec.bat +620 -0
- data/vendor/xspec-1.0.0/bin/xspec.sh +403 -0
- data/vendor/xspec-1.0.0/build.xml +369 -0
- data/vendor/xspec-1.0.0/editors/emacs/README +31 -0
- data/vendor/xspec-1.0.0/editors/emacs/schemas.xml +6 -0
- data/vendor/xspec-1.0.0/editors/oxygen/.cvsignore +2 -0
- data/vendor/xspec-1.0.0/editors/oxygen/README +11 -0
- data/vendor/xspec-1.0.0/editors/oxygen/build.xml +38 -0
- data/vendor/xspec-1.0.0/editors/oxygen/templates/xspec.xml +17 -0
- data/vendor/xspec-1.0.0/editors/oxygen/xspec.framework +175 -0
- data/vendor/xspec-1.0.0/find-examples.xml +37 -0
- data/vendor/xspec-1.0.0/find-examples.xsl +615 -0
- data/vendor/xspec-1.0.0/graphics/3angle-down.gif +0 -0
- data/vendor/xspec-1.0.0/graphics/3angle-right.gif +0 -0
- data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.class +0 -0
- data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.java +209 -0
- data/vendor/xspec-1.0.0/src/ant/find-test-failure.xsl +17 -0
- data/vendor/xspec-1.0.0/src/ant/get-schematron-phase.xsl +17 -0
- data/vendor/xspec-1.0.0/src/ant/locate-schematron.xsl +28 -0
- data/vendor/xspec-1.0.0/src/ant/make-path.js +4 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-common-tests.xsl +604 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-query-helper.xsl +152 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-query-tests.xsl +473 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-query-utils.xql +263 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-tests-helper.xsl +169 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-tests-utils.xsl +479 -0
- data/vendor/xspec-1.0.0/src/compiler/generate-xspec-tests.xsl +503 -0
- data/vendor/xspec-1.0.0/src/harnesses/basex/basex-standalone-xquery-harness.xproc +135 -0
- data/vendor/xspec-1.0.0/src/harnesses/basex/basex-xquery-harness.xproc +133 -0
- data/vendor/xspec-1.0.0/src/harnesses/exist/exist-xquery-harness.xproc +161 -0
- data/vendor/xspec-1.0.0/src/harnesses/harness-lib.xpl +327 -0
- data/vendor/xspec-1.0.0/src/harnesses/marklogic/ml-xquery-harness.xproc +143 -0
- data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xquery-harness.xproc +108 -0
- data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xslt-harness.xproc +85 -0
- data/vendor/xspec-1.0.0/src/harnesses/zorba/zorba-xquery-harness.xproc +134 -0
- data/vendor/xspec-1.0.0/src/reporter/coverage-report.xsl +378 -0
- data/vendor/xspec-1.0.0/src/reporter/format-utils.xsl +220 -0
- data/vendor/xspec-1.0.0/src/reporter/format-xspec-report-folding.xsl +164 -0
- data/vendor/xspec-1.0.0/src/reporter/format-xspec-report.xsl +410 -0
- data/vendor/xspec-1.0.0/src/reporter/junit-report.xsl +93 -0
- data/vendor/xspec-1.0.0/src/reporter/test-report.css +469 -0
- data/vendor/xspec-1.0.0/src/schemas/find-examples.rnc +90 -0
- data/vendor/xspec-1.0.0/src/schemas/xspec.rnc +304 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_abstract_expand.xsl +313 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_dsdl_include.xsl +1519 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message.xsl +64 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message_xslt2.xsl +64 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_saxon.xsl +2306 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_xslt1.xsl +1851 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt1.xsl +614 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt2.xsl +692 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/readme.txt +101 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-cs.xhtml +56 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-de.xhtml +55 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-en.xhtml +57 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-fr.xhtml +54 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-ja.xhtml +53 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-nl.xhtml +58 -0
- data/vendor/xspec-1.0.0/src/schematron/iso-schematron/schematron-skeleton-api.htm +723 -0
- data/vendor/xspec-1.0.0/src/schematron/sch-location-compare.xsl +139 -0
- data/vendor/xspec-1.0.0/src/schematron/schut-to-xspec.xsl +179 -0
- data/vendor/xspec-1.0.0/test/Makefile +117 -0
- data/vendor/xspec-1.0.0/test/README +5 -0
- data/vendor/xspec-1.0.0/test/catalog/xspec-160_catalog.xml +4 -0
- data/vendor/xspec-1.0.0/test/catalog/xspec-160_schematron.xspec +6 -0
- data/vendor/xspec-1.0.0/test/catalog/xspec-160_xslt.xspec +5 -0
- data/vendor/xspec-1.0.0/test/end-to-end/README.md +42 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/.gitignore +1 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/.gitignore +3 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-50-result-norm.html +74 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-55-result-norm.html +112 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-focus-1-result-norm.html +109 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-function-result-norm.html +118 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-import-result-norm.html +163 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-imported-result-norm.html +95 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-pending-result-norm.html +123 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-rule-result-norm.html +109 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-three-dots-result-norm.html +1237 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xsl +7 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xspec +10 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xsl +2 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xspec +18 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-focus-1.xspec +71 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-function.xspec +50 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-import.xspec +50 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-imported.xspec +48 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-pending.xspec +89 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-rule.xspec +76 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xsl +49 -0
- data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xspec +527 -0
- data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.cmd +51 -0
- data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.sh +25 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/_deserializer.xsl +53 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/_normalizer.xsl +192 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/_serializer.xsl +15 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl +35 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/compare.xsl +88 -0
- data/vendor/xspec-1.0.0/test/end-to-end/processor/normalize.xsl +28 -0
- data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.cmd +61 -0
- data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.sh +28 -0
- data/vendor/xspec-1.0.0/test/generate-tests-utils.xspec +636 -0
- data/vendor/xspec-1.0.0/test/generate-x-utils.xspec +173 -0
- data/vendor/xspec-1.0.0/test/generate-xspec-tests.xspec +64 -0
- data/vendor/xspec-1.0.0/test/run-xspec-tests.cmd +83 -0
- data/vendor/xspec-1.0.0/test/run-xspec-tests.sh +42 -0
- data/vendor/xspec-1.0.0/test/sch-location-compare.xspec +179 -0
- data/vendor/xspec-1.0.0/test/schematron/data/standards.xml +7 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-017.sch +9 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-018.sch +17 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-019.sch +13 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-020-01.sch +35 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-020.sch +32 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-021.sch +28 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-022.sch +18 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-compile.xsl +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-expand.xsl +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-include.xsl +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-in.xspec +5 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-out.xspec +7 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-in.xspec +5 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-out.xspec +7 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002.sch +4 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-in.xspec +7 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-out.xspec +9 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-in.xspec +20 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-out.xspec +22 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-in.xspec +6 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-out.xspec +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-in.xspec +11 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-out.xspec +13 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-in.xspec +7 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-out.xspec +9 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007.xml +2 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-in.xspec +9 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-out.xspec +9 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-import-in.xspec +5 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-in.xspec +6 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-out.xspec +10 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-import.xspec +5 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-in.xspec +6 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-out.xspec +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-in.xspec +6 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-out.xspec +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-01.xml +4 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-02.xml +13 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-out.xspec +81 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-in.xspec +6 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-out.xspec +8 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch +4 -0
- data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch.xsl +4 -0
- data/vendor/xspec-1.0.0/test/schematron-01.sch +17 -0
- data/vendor/xspec-1.0.0/test/schematron-01.xml +14 -0
- data/vendor/xspec-1.0.0/test/schematron-01.xspec +14 -0
- data/vendor/xspec-1.0.0/test/schematron-012.xspec +83 -0
- data/vendor/xspec-1.0.0/test/schematron-014-01.xml +10 -0
- data/vendor/xspec-1.0.0/test/schematron-014.sch +16 -0
- data/vendor/xspec-1.0.0/test/schematron-014.xspec +11 -0
- data/vendor/xspec-1.0.0/test/schematron-015.sch +16 -0
- data/vendor/xspec-1.0.0/test/schematron-015.xspec +11 -0
- data/vendor/xspec-1.0.0/test/schematron-016.sch +19 -0
- data/vendor/xspec-1.0.0/test/schematron-016.xspec +171 -0
- data/vendor/xspec-1.0.0/test/schematron-017.xspec +26 -0
- data/vendor/xspec-1.0.0/test/schematron-018.xspec +120 -0
- data/vendor/xspec-1.0.0/test/schematron-019.xspec +16 -0
- data/vendor/xspec-1.0.0/test/schematron-020.xspec +53 -0
- data/vendor/xspec-1.0.0/test/schematron-021.xspec +27 -0
- data/vendor/xspec-1.0.0/test/schematron-022.xspec +15 -0
- data/vendor/xspec-1.0.0/test/schematron-param-001.xspec +50 -0
- data/vendor/xspec-1.0.0/test/schut-to-xspec-012.sch +27 -0
- data/vendor/xspec-1.0.0/test/schut-to-xspec.xspec +85 -0
- data/vendor/xspec-1.0.0/test/unit-expect-xsl.xspec +28 -0
- data/vendor/xspec-1.0.0/test/xspec-26.xsl +19 -0
- data/vendor/xspec-1.0.0/test/xspec-26.xspec +17 -0
- data/vendor/xspec-1.0.0/test/xspec-30.xml +2 -0
- data/vendor/xspec-1.0.0/test/xspec-30.xsl +6 -0
- data/vendor/xspec-1.0.0/test/xspec-30.xspec +8 -0
- data/vendor/xspec-1.0.0/test/xspec-33.xsl +7 -0
- data/vendor/xspec-1.0.0/test/xspec-33.xspec +15 -0
- data/vendor/xspec-1.0.0/test/xspec-46.xsl +7 -0
- data/vendor/xspec-1.0.0/test/xspec-46.xspec +9 -0
- data/vendor/xspec-1.0.0/test/xspec-72.xsl +13 -0
- data/vendor/xspec-1.0.0/test/xspec-72.xspec +19 -0
- data/vendor/xspec-1.0.0/test/xspec-bat.cmd +757 -0
- data/vendor/xspec-1.0.0/test/xspec-focus-2.xspec +91 -0
- data/vendor/xspec-1.0.0/test/xspec-junit.xspec +78 -0
- data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xml +1003 -0
- data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xslt +10 -0
- data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xspec +13 -0
- data/vendor/xspec-1.0.0/test/xspec-tested.xql +44 -0
- data/vendor/xspec-1.0.0/test/xspec-tested.xsl +64 -0
- data/vendor/xspec-1.0.0/test/xspec-variable.xml +3 -0
- data/vendor/xspec-1.0.0/test/xspec-variable.xspec +58 -0
- data/vendor/xspec-1.0.0/test/xspec-xslt3.xsl +13 -0
- data/vendor/xspec-1.0.0/test/xspec-xslt3.xspec +12 -0
- data/vendor/xspec-1.0.0/test/xspec.bats +420 -0
- data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xslt +40 -0
- data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xspec +75 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.sch +17 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xml +11 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xspec +14 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseA.xspec +11 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseB.xspec +12 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import1.xspec +10 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import2.xspec +8 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import3.xspec +10 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.sch +58 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.xml +19 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc1.xml +6 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc2.xml +7 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.sch +29 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.xspec +63 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.sch +20 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.xspec +33 -0
- data/vendor/xspec-1.0.0/tutorial/schematron/quickfix.sch +81 -0
- data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xq +8 -0
- data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xspec +16 -0
- data/vendor/xspec-1.0.0/xproject/project.xml +8 -0
- data/vendor/xspec-1.0.0/xproject/release-project.xsl +41 -0
- metadata +341 -0
@@ -0,0 +1,527 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<x:description stylesheet="xspec-three-dots.xsl" xmlns:x="http://www.jenitennison.com/xslt/xspec">
|
3
|
+
<x:scenario label="For resultant element (simple)">
|
4
|
+
<x:scenario>
|
5
|
+
<x:label>When result is<![CDATA[
|
6
|
+
<elem>text</elem>
|
7
|
+
]]></x:label>
|
8
|
+
<x:context>
|
9
|
+
<elem>text</elem>
|
10
|
+
</x:context>
|
11
|
+
<x:expect select="elem">
|
12
|
+
<x:label>expecting<![CDATA[
|
13
|
+
<elem>...</elem>
|
14
|
+
]]>should be Success</x:label>
|
15
|
+
<elem>...</elem>
|
16
|
+
</x:expect>
|
17
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
18
|
+
</x:scenario>
|
19
|
+
|
20
|
+
<x:scenario>
|
21
|
+
<x:label>When result is<![CDATA[
|
22
|
+
<elem />
|
23
|
+
]]></x:label>
|
24
|
+
<x:context>
|
25
|
+
<elem />
|
26
|
+
</x:context>
|
27
|
+
<x:expect select="elem">
|
28
|
+
<x:label>expecting<![CDATA[
|
29
|
+
<elem>...</elem>
|
30
|
+
]]>should be Success</x:label>
|
31
|
+
<elem>...</elem>
|
32
|
+
</x:expect>
|
33
|
+
|
34
|
+
<x:expect select="elem">
|
35
|
+
<x:label>expecting<![CDATA[
|
36
|
+
<elem attrib="..." />
|
37
|
+
]]>should be Failure</x:label>
|
38
|
+
<elem attrib="..." />
|
39
|
+
</x:expect>
|
40
|
+
</x:scenario>
|
41
|
+
|
42
|
+
<x:scenario>
|
43
|
+
<x:label>When result is<![CDATA[
|
44
|
+
<elem>...</elem>
|
45
|
+
]]></x:label>
|
46
|
+
<x:context>
|
47
|
+
<elem>...</elem>
|
48
|
+
</x:context>
|
49
|
+
<x:expect select="elem">
|
50
|
+
<x:label>expecting<![CDATA[
|
51
|
+
<elem>...</elem>
|
52
|
+
]]>should be Success</x:label>
|
53
|
+
<elem>...</elem>
|
54
|
+
</x:expect>
|
55
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
56
|
+
|
57
|
+
<x:expect select="elem">
|
58
|
+
<x:label>expecting<![CDATA[
|
59
|
+
<elem>text</elem>
|
60
|
+
]]>should be Failure</x:label>
|
61
|
+
<elem>text</elem>
|
62
|
+
</x:expect>
|
63
|
+
</x:scenario>
|
64
|
+
</x:scenario>
|
65
|
+
|
66
|
+
<x:scenario label="For resultant element (with attribute)">
|
67
|
+
<x:scenario>
|
68
|
+
<x:label>When result is<![CDATA[
|
69
|
+
<elem attrib="val" />
|
70
|
+
]]></x:label>
|
71
|
+
<x:context>
|
72
|
+
<elem attrib="val" />
|
73
|
+
</x:context>
|
74
|
+
<x:expect select="elem">
|
75
|
+
<x:label>expecting<![CDATA[
|
76
|
+
<elem attrib="..." />
|
77
|
+
]]>should be Success</x:label>
|
78
|
+
<elem attrib="..." />
|
79
|
+
</x:expect>
|
80
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
81
|
+
|
82
|
+
<x:expect select="elem">
|
83
|
+
<x:label>expecting<![CDATA[
|
84
|
+
<elem>...</elem>
|
85
|
+
]]>should be Failure</x:label>
|
86
|
+
<elem>...</elem>
|
87
|
+
</x:expect>
|
88
|
+
</x:scenario>
|
89
|
+
</x:scenario>
|
90
|
+
|
91
|
+
<x:scenario label="For resultant element (with mixed content)">
|
92
|
+
<x:scenario>
|
93
|
+
<x:label>When result is<![CDATA[
|
94
|
+
<outer>text<inner1 /><inner2 /></outer>
|
95
|
+
]]></x:label>
|
96
|
+
<x:context>
|
97
|
+
<outer>text<inner1 /><inner2 /></outer>
|
98
|
+
</x:context>
|
99
|
+
<x:expect select="outer">
|
100
|
+
<x:label>expecting<![CDATA[
|
101
|
+
<outer>...</outer>
|
102
|
+
]]>should be Success</x:label>
|
103
|
+
<outer>...</outer>
|
104
|
+
</x:expect>
|
105
|
+
<x:expect select="outer">
|
106
|
+
<x:label>expecting<![CDATA[
|
107
|
+
<outer>...<inner1 />...</outer>
|
108
|
+
]]>should be Success</x:label>
|
109
|
+
<outer>...<inner1 />...</outer>
|
110
|
+
</x:expect>
|
111
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
112
|
+
</x:scenario>
|
113
|
+
|
114
|
+
<x:scenario>
|
115
|
+
<x:label>When result is<![CDATA[
|
116
|
+
<outer><inner /></outer>
|
117
|
+
]]></x:label>
|
118
|
+
<x:context>
|
119
|
+
<outer><inner /></outer>
|
120
|
+
</x:context>
|
121
|
+
<x:expect select="outer">
|
122
|
+
<x:label>expecting<![CDATA[
|
123
|
+
<outer>...</outer>
|
124
|
+
]]>should be Success</x:label>
|
125
|
+
<outer>...</outer>
|
126
|
+
</x:expect>
|
127
|
+
|
128
|
+
<x:expect select="outer">
|
129
|
+
<x:label>expecting<![CDATA[
|
130
|
+
<outer>...<inner /></outer>
|
131
|
+
]]>should be Failure</x:label>
|
132
|
+
<outer>...<inner /></outer>
|
133
|
+
</x:expect>
|
134
|
+
</x:scenario>
|
135
|
+
</x:scenario>
|
136
|
+
|
137
|
+
<x:scenario label="For resultant attribute">
|
138
|
+
<x:scenario>
|
139
|
+
<x:label>When result is<![CDATA[
|
140
|
+
@attrib="val"
|
141
|
+
]]></x:label>
|
142
|
+
<x:context select="elem/@*">
|
143
|
+
<elem attrib="val" />
|
144
|
+
</x:context>
|
145
|
+
<x:expect select="elem/@*">
|
146
|
+
<x:label>expecting<![CDATA[
|
147
|
+
@attrib="..."
|
148
|
+
]]>should be Success</x:label>
|
149
|
+
<elem attrib="..." />
|
150
|
+
</x:expect>
|
151
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
152
|
+
</x:scenario>
|
153
|
+
|
154
|
+
<x:scenario>
|
155
|
+
<x:label>When result is<![CDATA[
|
156
|
+
@attrib=""
|
157
|
+
]]></x:label>
|
158
|
+
<x:context select="elem/@*">
|
159
|
+
<elem attrib="" />
|
160
|
+
</x:context>
|
161
|
+
<x:expect select="elem/@*">
|
162
|
+
<x:label>expecting<![CDATA[
|
163
|
+
@attrib="..."
|
164
|
+
]]>should be Success</x:label>
|
165
|
+
<elem attrib="..." />
|
166
|
+
</x:expect>
|
167
|
+
</x:scenario>
|
168
|
+
|
169
|
+
<x:scenario>
|
170
|
+
<x:label>When result is<![CDATA[
|
171
|
+
@attrib="..."
|
172
|
+
]]></x:label>
|
173
|
+
<x:context select="elem/@*">
|
174
|
+
<elem attrib="..." />
|
175
|
+
</x:context>
|
176
|
+
<x:expect select="elem/@*">
|
177
|
+
<x:label>expecting<![CDATA[
|
178
|
+
@attrib="..."
|
179
|
+
]]>should be Success</x:label>
|
180
|
+
<elem attrib="..." />
|
181
|
+
</x:expect>
|
182
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
183
|
+
|
184
|
+
<x:expect select="elem/@*">
|
185
|
+
<x:label>expecting<![CDATA[
|
186
|
+
@attrib="val"
|
187
|
+
]]>should be Failure</x:label>
|
188
|
+
<elem attrib="val" />
|
189
|
+
</x:expect>
|
190
|
+
</x:scenario>
|
191
|
+
</x:scenario>
|
192
|
+
|
193
|
+
<x:scenario label="For resultant text node">
|
194
|
+
<x:scenario label="When result is usual text node">
|
195
|
+
<x:call function="exactly-one">
|
196
|
+
<x:param as="text()" select="$text-node_usual" />
|
197
|
+
</x:call>
|
198
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
199
|
+
|
200
|
+
<x:expect label="expecting '...' should be Failure" select="'...'" />
|
201
|
+
</x:scenario>
|
202
|
+
|
203
|
+
<x:scenario label="When result is whitespace-only text node">
|
204
|
+
<x:call function="exactly-one">
|
205
|
+
<x:param as="text()" select="$text-node_whitespace-only" />
|
206
|
+
</x:call>
|
207
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
208
|
+
|
209
|
+
<x:expect label="expecting usual text node should be Failure" select="$text-node_usual"
|
210
|
+
/>
|
211
|
+
</x:scenario>
|
212
|
+
|
213
|
+
<x:scenario label="When result is zero-length text node">
|
214
|
+
<x:call function="exactly-one">
|
215
|
+
<x:param as="text()" select="$text-node_zero-length" />
|
216
|
+
</x:call>
|
217
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
218
|
+
|
219
|
+
<x:expect label="expecting usual text node should be Failure" select="$text-node_usual"
|
220
|
+
/>
|
221
|
+
</x:scenario>
|
222
|
+
|
223
|
+
<x:scenario label="When result is three-dot text node">
|
224
|
+
<x:call function="exactly-one">
|
225
|
+
<x:param as="text()" select="$text-node_three-dots" />
|
226
|
+
</x:call>
|
227
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
228
|
+
|
229
|
+
<x:expect label="expecting usual text node should be Failure" select="$text-node_usual" />
|
230
|
+
<x:expect label="expecting '...' should be Failure" select="'...'" />
|
231
|
+
</x:scenario>
|
232
|
+
</x:scenario>
|
233
|
+
|
234
|
+
<x:scenario label="For resultant comment">
|
235
|
+
<x:scenario>
|
236
|
+
<x:label>When result is<![CDATA[
|
237
|
+
<!--comment-->
|
238
|
+
]]></x:label>
|
239
|
+
<x:context>
|
240
|
+
<!--comment-->
|
241
|
+
</x:context>
|
242
|
+
<x:expect select="comment()">
|
243
|
+
<x:label>expecting<![CDATA[
|
244
|
+
<!--...-->
|
245
|
+
]]>should be Success</x:label>
|
246
|
+
<!--...-->
|
247
|
+
</x:expect>
|
248
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
249
|
+
</x:scenario>
|
250
|
+
|
251
|
+
<x:scenario>
|
252
|
+
<x:label>When result is<![CDATA[
|
253
|
+
<!---->
|
254
|
+
]]></x:label>
|
255
|
+
<x:context>
|
256
|
+
<!---->
|
257
|
+
</x:context>
|
258
|
+
<x:expect select="comment()">
|
259
|
+
<x:label>expecting<![CDATA[
|
260
|
+
<!--...-->
|
261
|
+
]]>should be Success</x:label>
|
262
|
+
<!--...-->
|
263
|
+
</x:expect>
|
264
|
+
</x:scenario>
|
265
|
+
|
266
|
+
<x:scenario>
|
267
|
+
<x:label>When result is<![CDATA[
|
268
|
+
<!--...-->
|
269
|
+
]]></x:label>
|
270
|
+
<x:context>
|
271
|
+
<!--...-->
|
272
|
+
</x:context>
|
273
|
+
<x:expect select="comment()">
|
274
|
+
<x:label>expecting<![CDATA[
|
275
|
+
<!--...-->
|
276
|
+
]]>should be Success</x:label>
|
277
|
+
<!--...-->
|
278
|
+
</x:expect>
|
279
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
280
|
+
|
281
|
+
<x:expect select="comment()">
|
282
|
+
<x:label>expecting<![CDATA[
|
283
|
+
<!--comment-->
|
284
|
+
]]>should be Failure</x:label>
|
285
|
+
<!--comment-->
|
286
|
+
</x:expect>
|
287
|
+
</x:scenario>
|
288
|
+
</x:scenario>
|
289
|
+
|
290
|
+
<x:scenario label="For resultant processing instruction">
|
291
|
+
<x:scenario>
|
292
|
+
<x:label>When result is<![CDATA[
|
293
|
+
<?pi data?>
|
294
|
+
]]></x:label>
|
295
|
+
<x:context>
|
296
|
+
<?pi data?>
|
297
|
+
</x:context>
|
298
|
+
<x:expect select="processing-instruction()">
|
299
|
+
<x:label>expecting<![CDATA[
|
300
|
+
<?pi ...?>
|
301
|
+
]]>should be Success</x:label>
|
302
|
+
<?pi ...?>
|
303
|
+
</x:expect>
|
304
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
305
|
+
</x:scenario>
|
306
|
+
|
307
|
+
<x:scenario>
|
308
|
+
<x:label>When result is<![CDATA[
|
309
|
+
<?pi?>
|
310
|
+
]]></x:label>
|
311
|
+
<x:context>
|
312
|
+
<?pi?>
|
313
|
+
</x:context>
|
314
|
+
<x:expect select="processing-instruction()">
|
315
|
+
<x:label>expecting<![CDATA[
|
316
|
+
<?pi ...?>
|
317
|
+
]]>should be Success</x:label>
|
318
|
+
<?pi ...?>
|
319
|
+
</x:expect>
|
320
|
+
</x:scenario>
|
321
|
+
|
322
|
+
<x:scenario>
|
323
|
+
<x:label>When result is<![CDATA[
|
324
|
+
<?pi ...?>
|
325
|
+
]]></x:label>
|
326
|
+
<x:context>
|
327
|
+
<?pi ...?>
|
328
|
+
</x:context>
|
329
|
+
<x:expect select="processing-instruction()">
|
330
|
+
<x:label>expecting<![CDATA[
|
331
|
+
<?pi ...?>
|
332
|
+
]]>should be Success</x:label>
|
333
|
+
<?pi ...?>
|
334
|
+
</x:expect>
|
335
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
336
|
+
|
337
|
+
<x:expect select="processing-instruction()">
|
338
|
+
<x:label>expecting<![CDATA[
|
339
|
+
<?pi data?>
|
340
|
+
]]>should be Failure</x:label>
|
341
|
+
<?pi data?>
|
342
|
+
</x:expect>
|
343
|
+
</x:scenario>
|
344
|
+
</x:scenario>
|
345
|
+
|
346
|
+
<x:scenario label="For resultant document node">
|
347
|
+
<x:scenario>
|
348
|
+
<x:label>When result is<![CDATA[
|
349
|
+
<xsl:document><?pi?><!--comment--><elem /></xsl:document>
|
350
|
+
]]></x:label>
|
351
|
+
<x:call function="exactly-one">
|
352
|
+
<x:param as="document-node()" select="$document-node_multiple-nodes" />
|
353
|
+
</x:call>
|
354
|
+
<x:expect select="$document-node_three-dots">
|
355
|
+
<x:label>expecting<![CDATA[
|
356
|
+
<xsl:document>...</xsl:document>
|
357
|
+
]]>should be Success</x:label>
|
358
|
+
</x:expect>
|
359
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
360
|
+
</x:scenario>
|
361
|
+
|
362
|
+
<x:scenario>
|
363
|
+
<x:label>When result is<![CDATA[
|
364
|
+
<xsl:document />
|
365
|
+
]]></x:label>
|
366
|
+
<x:call function="exactly-one">
|
367
|
+
<x:param as="document-node()" select="$document-node_empty" />
|
368
|
+
</x:call>
|
369
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
370
|
+
|
371
|
+
<x:expect select="$document-node_three-dots">
|
372
|
+
<x:label>expecting<![CDATA[
|
373
|
+
<xsl:document>...</xsl:document>
|
374
|
+
]]>should be Failure</x:label>
|
375
|
+
</x:expect>
|
376
|
+
</x:scenario>
|
377
|
+
|
378
|
+
<x:scenario>
|
379
|
+
<x:label>When result is<![CDATA[
|
380
|
+
<xsl:document>...</xsl:document>
|
381
|
+
]]></x:label>
|
382
|
+
<x:call function="exactly-one">
|
383
|
+
<x:param as="document-node()" select="$document-node_three-dots" />
|
384
|
+
</x:call>
|
385
|
+
<x:expect select="$document-node_three-dots">
|
386
|
+
<x:label>expecting<![CDATA[
|
387
|
+
<xsl:document>...</xsl:document>
|
388
|
+
]]>should be Success</x:label>
|
389
|
+
</x:expect>
|
390
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
391
|
+
|
392
|
+
<x:expect select="$document-node_text">
|
393
|
+
<x:label>expecting<![CDATA[
|
394
|
+
<xsl:document>text</xsl:document>
|
395
|
+
]]>should be Failure</x:label>
|
396
|
+
</x:expect>
|
397
|
+
</x:scenario>
|
398
|
+
</x:scenario>
|
399
|
+
|
400
|
+
<x:scenario label="For resultant namespace node (TODO: xspec/xspec#67)">
|
401
|
+
<x:scenario>
|
402
|
+
<x:label>When result is<![CDATA[
|
403
|
+
xmlns:prefix="namespace-uri"
|
404
|
+
]]></x:label>
|
405
|
+
<x:call function="exactly-one">
|
406
|
+
<x:param as="node()" select="elem/namespace::prefix">
|
407
|
+
<elem xmlns:prefix="namespace-uri" />
|
408
|
+
</x:param>
|
409
|
+
</x:call>
|
410
|
+
<x:expect select="elem/namespace::prefix">
|
411
|
+
<x:label>expecting<![CDATA[
|
412
|
+
xmlns:prefix="..."
|
413
|
+
]]>should be Success</x:label>
|
414
|
+
<elem xmlns:prefix="..." />
|
415
|
+
</x:expect>
|
416
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
417
|
+
</x:scenario>
|
418
|
+
|
419
|
+
<x:scenario>
|
420
|
+
<x:label>When result is<![CDATA[
|
421
|
+
xmlns="namespace-uri"
|
422
|
+
]]></x:label>
|
423
|
+
<x:call function="exactly-one">
|
424
|
+
<x:param as="node()" select="*:elem/namespace::*[not(name())]">
|
425
|
+
<elem xmlns="namespace-uri" />
|
426
|
+
</x:param>
|
427
|
+
</x:call>
|
428
|
+
<x:expect select="*:elem/namespace::*[not(name())]">
|
429
|
+
<x:label>expecting<![CDATA[
|
430
|
+
xmlns="..."
|
431
|
+
]]>should be Success</x:label>
|
432
|
+
<elem xmlns="..." />
|
433
|
+
</x:expect>
|
434
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
435
|
+
</x:scenario>
|
436
|
+
|
437
|
+
<x:scenario>
|
438
|
+
<x:label>When result is<![CDATA[
|
439
|
+
xmlns:prefix="..."
|
440
|
+
]]></x:label>
|
441
|
+
<x:call function="exactly-one">
|
442
|
+
<x:param as="node()" select="elem/namespace::prefix">
|
443
|
+
<elem xmlns:prefix="..." />
|
444
|
+
</x:param>
|
445
|
+
</x:call>
|
446
|
+
<x:expect select="elem/namespace::prefix">
|
447
|
+
<x:label>expecting<![CDATA[
|
448
|
+
xmlns:prefix="..."
|
449
|
+
]]>should be Success</x:label>
|
450
|
+
<elem xmlns:prefix="..." />
|
451
|
+
</x:expect>
|
452
|
+
<x:expect label="expecting ... should be Success">...</x:expect>
|
453
|
+
|
454
|
+
<x:expect select="elem/namespace::prefix">
|
455
|
+
<x:label>expecting<![CDATA[
|
456
|
+
xmlns:prefix="namespace-uri"
|
457
|
+
]]>should be Failure</x:label>
|
458
|
+
<elem xmlns:prefix="namespace-uri" />
|
459
|
+
</x:expect>
|
460
|
+
</x:scenario>
|
461
|
+
</x:scenario>
|
462
|
+
|
463
|
+
<x:scenario label="For resultant sequence of multiple nodes">
|
464
|
+
<x:scenario>
|
465
|
+
<x:label>When result is sequence of<![CDATA[
|
466
|
+
<elem1 /><elem2 />
|
467
|
+
]]></x:label>
|
468
|
+
<x:context>
|
469
|
+
<elem1 /><elem2 />
|
470
|
+
</x:context>
|
471
|
+
<x:expect select="wrap/node()">
|
472
|
+
<x:label>expecting<![CDATA[
|
473
|
+
...<elem2 />
|
474
|
+
]]>should be Success</x:label>
|
475
|
+
<wrap>...<elem2 /></wrap>
|
476
|
+
</x:expect>
|
477
|
+
<x:expect label="expecting sequence of two ... should be Success" select="wrap/text()">
|
478
|
+
<wrap>...</wrap>
|
479
|
+
<wrap>...</wrap>
|
480
|
+
</x:expect>
|
481
|
+
|
482
|
+
<x:expect label="expecting ... should be Failure">...</x:expect>
|
483
|
+
<x:expect label="expecting ...... should be Failure">......</x:expect>
|
484
|
+
<x:expect label="expecting sequence of three ... should be Failure" select="wrap/text()">
|
485
|
+
<wrap>...</wrap>
|
486
|
+
<wrap>...</wrap>
|
487
|
+
<wrap>...</wrap>
|
488
|
+
</x:expect>
|
489
|
+
</x:scenario>
|
490
|
+
</x:scenario>
|
491
|
+
|
492
|
+
<x:scenario label="When result is empty sequence">
|
493
|
+
<x:context select="()" />
|
494
|
+
<x:expect label="expecting ... should be Failure">...</x:expect>
|
495
|
+
</x:scenario>
|
496
|
+
|
497
|
+
<x:scenario label="For resultant atomic value">
|
498
|
+
<x:scenario label="When result is 'string'">
|
499
|
+
<x:call function="exactly-one">
|
500
|
+
<x:param as="xs:string" select="'string'" />
|
501
|
+
</x:call>
|
502
|
+
<x:expect label="expecting 'string' should be Success" select="'string'" />
|
503
|
+
|
504
|
+
<x:expect label="expecting ... should be Failure">...</x:expect>
|
505
|
+
<x:expect label="expecting '...' should be Failure" select="'...'" />
|
506
|
+
</x:scenario>
|
507
|
+
|
508
|
+
<x:scenario label="When result is '...'">
|
509
|
+
<x:call function="exactly-one">
|
510
|
+
<x:param as="xs:string" select="'...'" />
|
511
|
+
</x:call>
|
512
|
+
<x:expect label="expecting '...' should be Success" select="'...'" />
|
513
|
+
|
514
|
+
<x:expect label="expecting ... should be Failure">...</x:expect>
|
515
|
+
<x:expect label="expecting 'string' should be Failure" select="'string'" />
|
516
|
+
</x:scenario>
|
517
|
+
</x:scenario>
|
518
|
+
|
519
|
+
<x:scenario label="For any resultant item">
|
520
|
+
<x:context>item</x:context>
|
521
|
+
<x:expect label="expecting .... (four dots) should be Failure">....</x:expect>
|
522
|
+
<x:expect label="expecting ...x (three dots with extra character) should be Failure"
|
523
|
+
>...x</x:expect>
|
524
|
+
<x:expect label="expecting ... with surrounding whitespace should be Failure" xml:space="preserve"> ...</x:expect>
|
525
|
+
<x:expect label="expecting '...' (xs:string) should be Failure" select="'...'" />
|
526
|
+
</x:scenario>
|
527
|
+
</x:description>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
@echo off
|
2
|
+
|
3
|
+
rem
|
4
|
+
rem Begin localization of environment changes.
|
5
|
+
rem Also make sure the command processor extensions are enabled.
|
6
|
+
rem
|
7
|
+
verify other 2> NUL
|
8
|
+
setlocal enableextensions
|
9
|
+
if errorlevel 1 (
|
10
|
+
echo Unable to enable extensions
|
11
|
+
exit /b %ERRORLEVEL%
|
12
|
+
)
|
13
|
+
|
14
|
+
rem
|
15
|
+
rem Go to the directory where this script resides
|
16
|
+
rem
|
17
|
+
pushd "%~dp0"
|
18
|
+
|
19
|
+
rem
|
20
|
+
rem .xspec files directory
|
21
|
+
rem
|
22
|
+
set CASES_DIR=cases
|
23
|
+
|
24
|
+
rem
|
25
|
+
rem XSpec output directory
|
26
|
+
rem
|
27
|
+
set TEST_DIR=%CASES_DIR%\expected
|
28
|
+
|
29
|
+
rem
|
30
|
+
rem Process .xspec files
|
31
|
+
rem
|
32
|
+
for %%I in ("%CASES_DIR%\*.xspec") do (
|
33
|
+
echo:
|
34
|
+
echo ----------
|
35
|
+
echo Processing "%%~I"...
|
36
|
+
|
37
|
+
rem
|
38
|
+
rem Generate the report HTML
|
39
|
+
rem
|
40
|
+
"%COMSPEC%" /c ..\..\bin\xspec.bat "%%~I"
|
41
|
+
|
42
|
+
rem
|
43
|
+
rem Normalize the report HTML
|
44
|
+
rem
|
45
|
+
java -classpath "%SAXON_CP%" net.sf.saxon.Transform -o:"%TEST_DIR%\%%~nI-result-norm.html" -s:"%TEST_DIR%\%%~nI-result.html" -xsl:processor\normalize.xsl
|
46
|
+
)
|
47
|
+
|
48
|
+
rem
|
49
|
+
rem Go back to the initial directory
|
50
|
+
rem
|
51
|
+
popd
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# This script must be run from the script's directory
|
4
|
+
|
5
|
+
# .xspec files directory
|
6
|
+
CASES_DIR=cases
|
7
|
+
|
8
|
+
# XSpec output directory
|
9
|
+
export TEST_DIR=${CASES_DIR}/expected
|
10
|
+
|
11
|
+
# Process .xspec files
|
12
|
+
for CASE_FILEPATH in ${CASES_DIR}/*.xspec
|
13
|
+
do
|
14
|
+
echo
|
15
|
+
echo "----------"
|
16
|
+
echo "Processing ${CASE_FILEPATH}..."
|
17
|
+
|
18
|
+
# Generate the report HTML
|
19
|
+
../../bin/xspec.sh ${CASE_FILEPATH}
|
20
|
+
|
21
|
+
# Normalize the report HTML
|
22
|
+
CASE_FILENAME=${CASE_FILEPATH##*/}
|
23
|
+
CASE_BASENAME=${CASE_FILENAME%.xspec}
|
24
|
+
java -classpath ${SAXON_CP} net.sf.saxon.Transform -o:${TEST_DIR}/${CASE_BASENAME}-result-norm.html -s:${TEST_DIR}/${CASE_BASENAME}-result.html -xsl:processor/normalize.xsl
|
25
|
+
done
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xsl:stylesheet exclude-result-prefixes="#all" version="2.0"
|
3
|
+
xmlns:deserializer="x-urn:xspec:test:end-to-end:processor:deserializer"
|
4
|
+
xmlns:local="x-urn:xspec:test:end-to-end:processor:deserializer:local"
|
5
|
+
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
6
|
+
xpath-default-namespace="http://www.w3.org/1999/xhtml">
|
7
|
+
|
8
|
+
<!--
|
9
|
+
This stylesheet module helps deserialize the report HTML.
|
10
|
+
-->
|
11
|
+
|
12
|
+
<!--
|
13
|
+
Public functions
|
14
|
+
-->
|
15
|
+
|
16
|
+
<!-- Removes side effect of loading indented HTML -->
|
17
|
+
<xsl:function as="document-node()" name="deserializer:unindent">
|
18
|
+
<xsl:param as="document-node()" name="doc" />
|
19
|
+
|
20
|
+
<xsl:apply-templates mode="local:unindent" select="$doc" />
|
21
|
+
</xsl:function>
|
22
|
+
|
23
|
+
<!--
|
24
|
+
Private templates
|
25
|
+
-->
|
26
|
+
|
27
|
+
<!-- Identity template, in lowest priority -->
|
28
|
+
<xsl:template as="node()" match="document-node() | attribute() | node()" mode="local:unindent"
|
29
|
+
priority="-1">
|
30
|
+
<xsl:copy>
|
31
|
+
<xsl:apply-templates mode="#current" select="attribute() | node()" />
|
32
|
+
</xsl:copy>
|
33
|
+
</xsl:template>
|
34
|
+
|
35
|
+
<!--
|
36
|
+
Removes insignificant whitespace (artifact of serialization indent) from text node
|
37
|
+
This is an ad hoc implementation only suitable for the report HTML.
|
38
|
+
-->
|
39
|
+
<xsl:template as="text()?" match="text()[not(parent::pre)]" mode="local:unindent">
|
40
|
+
<xsl:choose>
|
41
|
+
<xsl:when test="normalize-space()">
|
42
|
+
<!-- Remove whitespace-only tail line -->
|
43
|
+
<xsl:variable as="xs:string" name="tail-removed" select="replace(., '\n +$', '')" />
|
44
|
+
|
45
|
+
<!-- Compress whitespace -->
|
46
|
+
<xsl:value-of select="replace($tail-removed, '[ \n\t]+', ' ')" />
|
47
|
+
</xsl:when>
|
48
|
+
<xsl:otherwise>
|
49
|
+
<!-- Remove whitespace-only text node -->
|
50
|
+
</xsl:otherwise>
|
51
|
+
</xsl:choose>
|
52
|
+
</xsl:template>
|
53
|
+
</xsl:stylesheet>
|