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,692 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!--
|
3
|
+
ISO_SVRL.xsl
|
4
|
+
|
5
|
+
Implementation of Schematron Validation Report Language from ISO Schematron
|
6
|
+
ISO/IEC 19757 Document Schema Definition Languages (DSDL)
|
7
|
+
Part 3: Rule-based validation Schematron
|
8
|
+
Annex D: Schematron Validation Report Language
|
9
|
+
|
10
|
+
This ISO Standard is available free as a Publicly Available Specification in PDF from ISO.
|
11
|
+
Also see www.schematron.com for drafts and other information.
|
12
|
+
|
13
|
+
This implementation of SVRL is designed to run with the "Skeleton" implementation
|
14
|
+
of Schematron which Oliver Becker devised. The skeleton code provides a
|
15
|
+
Schematron implementation but with named templates for handling all output;
|
16
|
+
the skeleton provides basic templates for output using this API, but client
|
17
|
+
validators can be written to import the skeleton and override the default output
|
18
|
+
templates as required. (In order to understand this, you must understand that
|
19
|
+
a named template such as "process-assert" in this XSLT stylesheet overrides and
|
20
|
+
replaces any template with the same name in the imported skeleton XSLT file.)
|
21
|
+
|
22
|
+
The other important thing to understand in this code is that there are different
|
23
|
+
versions of the Schematron skeleton. These track the development of Schematron through
|
24
|
+
Schematron 1.5, Schematron 1.6 and now ISO Schematron. One only skeleton must be
|
25
|
+
imported. The code has templates for the different skeletons commented out for
|
26
|
+
convenience. ISO Schematron has a different namespace than Schematron 1.5 and 1.6;
|
27
|
+
so the ISO Schematron skeleton has been written itself with an optional import
|
28
|
+
statement to in turn import the Schematron 1.6 skeleton. This will allow you to
|
29
|
+
validate with schemas from either namespace.
|
30
|
+
|
31
|
+
|
32
|
+
History:
|
33
|
+
2010-07-10
|
34
|
+
* MIT license
|
35
|
+
2010-04-14
|
36
|
+
* Add command line parameter 'terminate' which will terminate on first failed
|
37
|
+
assert and (optionally) successful report.
|
38
|
+
2009-03-18
|
39
|
+
* Fix atrribute with space "see " which generates wrong name in some processors
|
40
|
+
* rename allow-foreign to allow-rich
|
41
|
+
|
42
|
+
2009-02-19
|
43
|
+
* RJ add experimental non-standard attribute active-pattern/@document which says which
|
44
|
+
document is being validated from that point to the next similar. This is to cope with the
|
45
|
+
experimental multi-document validation in the XSLT2 skeleton.
|
46
|
+
2008-08-19
|
47
|
+
* RJ Experimental: Handle property elements. NOTE: signature change for process-assert,
|
48
|
+
process-report and process-rule to add property.
|
49
|
+
2008-08-11
|
50
|
+
* RJ Fix attribute/@select which saxon allows in XSLT 1
|
51
|
+
2008-08-07
|
52
|
+
* RJ Add output-encoding attribute to specify final encoding to use
|
53
|
+
* Alter allow-foreign functionality so that Schematron span, emph and dir elements make
|
54
|
+
it to the output, for better formatting and because span can be used to mark up
|
55
|
+
semantically interesting information embedded in diagnostics, which reduces the
|
56
|
+
need to extend SVRL itself
|
57
|
+
* Diagnostic-reference had an invalid attribute @id that duplicated @diagnostic: removed
|
58
|
+
2008-08-06
|
59
|
+
* RJ Fix invalid output: svrl:diagnostic-reference is not contained in an svrl:text
|
60
|
+
* Output comment to SVRL file giving filename if available (from command-line parameter)
|
61
|
+
2008-08-04
|
62
|
+
* RJ move sch: prefix to schold: prefix to prevent confusion (we want people to
|
63
|
+
be able to switch from old namespace to new namespace without changing the
|
64
|
+
sch: prefix, so it is better to keep that prefix completely out of the XSLT)
|
65
|
+
* Extra signature fixes (PH)
|
66
|
+
2008-08-03
|
67
|
+
* Repair missing class parameter on process-p
|
68
|
+
2008-07-31
|
69
|
+
* Update skeleton names
|
70
|
+
2007-04-03
|
71
|
+
* Add option generate-fired-rule (RG)
|
72
|
+
2007-02-07
|
73
|
+
* Prefer true|false for parameters. But allow yes|no on some old for compatability
|
74
|
+
* DP Diagnostics output to svrl:text. Diagnosis put out after assertion text.
|
75
|
+
* Removed non-SVRL elements and attributes: better handled as an extra layer that invokes this one
|
76
|
+
* Add more formal parameters
|
77
|
+
* Correct confusion between $schemaVersion and $queryBinding
|
78
|
+
* Indent
|
79
|
+
* Validate against RNC schemas for XSLT 1 and 2 (with regex tests removed)
|
80
|
+
* Validate output with UniversalTest.sch against RNC schema for ISO SVRL
|
81
|
+
|
82
|
+
2007-02-01
|
83
|
+
* DP. Update formal parameters of overriding named templates to handle more attributes.
|
84
|
+
* DP. Refactor handling of rich and linkable parameters to a named template.
|
85
|
+
|
86
|
+
2007-01-22
|
87
|
+
* DP change svrl:ns to svrl:ns-in-attribute-value
|
88
|
+
* Change default when no queryBinding from "unknown" to "xslt"
|
89
|
+
|
90
|
+
2007-01-18:
|
91
|
+
* Improve documentation
|
92
|
+
* KH Add command-line options to generate paths or not
|
93
|
+
* Use axsl:attribute rather than xsl:attribute to shut XSLT2 up
|
94
|
+
* Add extra command-line options to pass to the iso_schematron_skeleton
|
95
|
+
|
96
|
+
2006-12-01: iso_svrl.xsl Rick Jelliffe,
|
97
|
+
* update namespace,
|
98
|
+
* update phase handling,
|
99
|
+
* add flag param to process-assert and process-report & @ flag on output
|
100
|
+
|
101
|
+
2001: Conformance1-5.xsl Rick Jelliffe,
|
102
|
+
* Created, using the skeleton code contributed by Oliver Becker
|
103
|
+
-->
|
104
|
+
<!--
|
105
|
+
Open Source Initiative OSI - The MIT License:Licensing
|
106
|
+
[OSI Approved License]
|
107
|
+
|
108
|
+
This source code was previously available under the zlib/libpng license.
|
109
|
+
Attribution is polite.
|
110
|
+
|
111
|
+
The MIT License
|
112
|
+
|
113
|
+
Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan
|
114
|
+
|
115
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
116
|
+
of this software and associated documentation files (the "Software"), to deal
|
117
|
+
in the Software without restriction, including without limitation the rights
|
118
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
119
|
+
copies of the Software, and to permit persons to whom the Software is
|
120
|
+
furnished to do so, subject to the following conditions:
|
121
|
+
|
122
|
+
The above copyright notice and this permission notice shall be included in
|
123
|
+
all copies or substantial portions of the Software.
|
124
|
+
|
125
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
126
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
127
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
128
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
129
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
130
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
131
|
+
THE SOFTWARE.
|
132
|
+
-->
|
133
|
+
|
134
|
+
<!-- Ideas nabbed from schematrons by Francis N., Miloslav N. and David C. -->
|
135
|
+
|
136
|
+
<!-- The command-line parameters are:
|
137
|
+
phase NMTOKEN | "#ALL" (default) Select the phase for validation
|
138
|
+
allow-foreign "true" | "false" (default) Pass non-Schematron elements and rich markup to the generated stylesheet
|
139
|
+
diagnose= true | false|yes|no Add the diagnostics to the assertion test in reports (yes|no are obsolete)
|
140
|
+
property= true | false Experimental: Add properties to the assertion test in reports
|
141
|
+
generate-paths=true|false|yes|no generate the @location attribute with XPaths (yes|no are obsolete)
|
142
|
+
sch.exslt.imports semi-colon delimited string of filenames for some EXSLT implementations
|
143
|
+
optimize "visit-no-attributes" Use only when the schema has no attributes as the context nodes
|
144
|
+
generate-fired-rule "true"(default) | "false" Generate fired-rule elements
|
145
|
+
terminate= yes | no | true | false | assert Terminate on the first failed assertion or successful report
|
146
|
+
Note: whether any output at all is generated depends on the XSLT implementation.
|
147
|
+
-->
|
148
|
+
|
149
|
+
<xsl:stylesheet
|
150
|
+
version="1.0"
|
151
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
152
|
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
153
|
+
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
|
154
|
+
xmlns:schold="http://www.ascc.net/xml/schematron"
|
155
|
+
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
156
|
+
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
157
|
+
|
158
|
+
>
|
159
|
+
|
160
|
+
<!-- Select the import statement and adjust the path as
|
161
|
+
necessary for your system.
|
162
|
+
-->
|
163
|
+
<xsl:import href="iso_schematron_skeleton_for_saxon.xsl"/>
|
164
|
+
|
165
|
+
<!--
|
166
|
+
<xsl:import href="iso_schematron_skeleton_for_xslt1.xsl"/>
|
167
|
+
|
168
|
+
<xsl:import href="iso_schematron_skeleton.xsl"/>
|
169
|
+
<xsl:import href="skeleton1-5.xsl"/>
|
170
|
+
<xsl:import href="skeleton1-6.xsl"/>
|
171
|
+
-->
|
172
|
+
|
173
|
+
<xsl:param name="diagnose">true</xsl:param>
|
174
|
+
<xsl:param name="property">true</xsl:param>
|
175
|
+
<xsl:param name="phase">
|
176
|
+
<xsl:choose>
|
177
|
+
<!-- Handle Schematron 1.5 and 1.6 phases -->
|
178
|
+
<xsl:when test="//schold:schema/@defaultPhase">
|
179
|
+
<xsl:value-of select="//schold:schema/@defaultPhase"/>
|
180
|
+
</xsl:when>
|
181
|
+
<!-- Handle ISO Schematron phases -->
|
182
|
+
<xsl:when test="//iso:schema/@defaultPhase">
|
183
|
+
<xsl:value-of select="//iso:schema/@defaultPhase"/>
|
184
|
+
</xsl:when>
|
185
|
+
<xsl:otherwise>#ALL</xsl:otherwise>
|
186
|
+
</xsl:choose>
|
187
|
+
</xsl:param>
|
188
|
+
<xsl:param name="allow-foreign">false</xsl:param>
|
189
|
+
<xsl:param name="generate-paths">true</xsl:param>
|
190
|
+
<xsl:param name="generate-fired-rule">true</xsl:param>
|
191
|
+
<xsl:param name="optimize" />
|
192
|
+
<!-- e.g. saxon file.xml file.xsl "sch.exslt.imports=.../string.xsl;.../math.xsl" -->
|
193
|
+
<xsl:param name="sch.exslt.imports" />
|
194
|
+
|
195
|
+
<xsl:param name="terminate" >false</xsl:param>
|
196
|
+
|
197
|
+
<!-- Set the language code for messages -->
|
198
|
+
<xsl:param name="langCode">default</xsl:param>
|
199
|
+
|
200
|
+
<xsl:param name="output-encoding"/>
|
201
|
+
|
202
|
+
<!-- Set the default for schematron-select-full-path, i.e. the notation for svrl's @location-->
|
203
|
+
<xsl:param name="full-path-notation">1</xsl:param>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<!-- Experimental: If this file called, then must be generating svrl -->
|
208
|
+
<xsl:variable name="svrlTest" select="true()" />
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<!-- ================================================================ -->
|
213
|
+
|
214
|
+
<xsl:template name="process-prolog">
|
215
|
+
<axsl:output method="xml" omit-xml-declaration="no" standalone="yes"
|
216
|
+
indent="yes">
|
217
|
+
<xsl:if test=" string-length($output-encoding) > 0">
|
218
|
+
<xsl:attribute name="encoding"><xsl:value-of select=" $output-encoding" /></xsl:attribute>
|
219
|
+
</xsl:if>
|
220
|
+
</axsl:output>
|
221
|
+
|
222
|
+
</xsl:template>
|
223
|
+
|
224
|
+
<!-- Overrides skeleton.xsl -->
|
225
|
+
<xsl:template name="process-root">
|
226
|
+
<xsl:param name="title"/>
|
227
|
+
<xsl:param name="contents" />
|
228
|
+
<xsl:param name="queryBinding" >xslt1</xsl:param>
|
229
|
+
<xsl:param name="schemaVersion" />
|
230
|
+
<xsl:param name="id" />
|
231
|
+
<xsl:param name="version"/>
|
232
|
+
<!-- "Rich" parameters -->
|
233
|
+
<xsl:param name="fpi" />
|
234
|
+
<xsl:param name="icon" />
|
235
|
+
<xsl:param name="lang" />
|
236
|
+
<xsl:param name="see" />
|
237
|
+
<xsl:param name="space" />
|
238
|
+
|
239
|
+
<svrl:schematron-output title="{$title}" schemaVersion="{$schemaVersion}" >
|
240
|
+
<xsl:if test=" string-length( normalize-space( $phase )) > 0 and
|
241
|
+
not( normalize-space( $phase ) = '#ALL') ">
|
242
|
+
<axsl:attribute name="phase">
|
243
|
+
<xsl:value-of select=" $phase " />
|
244
|
+
</axsl:attribute>
|
245
|
+
</xsl:if>
|
246
|
+
|
247
|
+
<axsl:comment><axsl:value-of select="$archiveDirParameter"/>  
|
248
|
+
<axsl:value-of select="$archiveNameParameter"/>  
|
249
|
+
<axsl:value-of select="$fileNameParameter"/>  
|
250
|
+
<axsl:value-of select="$fileDirParameter"/></axsl:comment>
|
251
|
+
|
252
|
+
|
253
|
+
<xsl:apply-templates mode="do-schema-p" />
|
254
|
+
<xsl:copy-of select="$contents" />
|
255
|
+
</svrl:schematron-output>
|
256
|
+
</xsl:template>
|
257
|
+
|
258
|
+
|
259
|
+
<xsl:template name="process-assert">
|
260
|
+
<xsl:param name="test"/>
|
261
|
+
<xsl:param name="diagnostics" />
|
262
|
+
<xsl:param name="properties" />
|
263
|
+
<xsl:param name="id" />
|
264
|
+
<xsl:param name="flag" />
|
265
|
+
<!-- "Linkable" parameters -->
|
266
|
+
<xsl:param name="role"/>
|
267
|
+
<xsl:param name="subject"/>
|
268
|
+
<!-- "Rich" parameters -->
|
269
|
+
<xsl:param name="fpi" />
|
270
|
+
<xsl:param name="icon" />
|
271
|
+
<xsl:param name="lang" />
|
272
|
+
<xsl:param name="see" />
|
273
|
+
<xsl:param name="space" />
|
274
|
+
<svrl:failed-assert test="{$test}" >
|
275
|
+
<xsl:if test="string-length( $id ) > 0">
|
276
|
+
<axsl:attribute name="id">
|
277
|
+
<xsl:value-of select=" $id " />
|
278
|
+
</axsl:attribute>
|
279
|
+
</xsl:if>
|
280
|
+
<xsl:if test=" string-length( $flag ) > 0">
|
281
|
+
<axsl:attribute name="flag">
|
282
|
+
<xsl:value-of select=" $flag " />
|
283
|
+
</axsl:attribute>
|
284
|
+
</xsl:if>
|
285
|
+
<!-- Process rich attributes. -->
|
286
|
+
<xsl:call-template name="richParms">
|
287
|
+
<xsl:with-param name="fpi" select="$fpi"/>
|
288
|
+
<xsl:with-param name="icon" select="$icon"/>
|
289
|
+
<xsl:with-param name="lang" select="$lang"/>
|
290
|
+
<xsl:with-param name="see" select="$see" />
|
291
|
+
<xsl:with-param name="space" select="$space" />
|
292
|
+
</xsl:call-template>
|
293
|
+
<xsl:call-template name='linkableParms'>
|
294
|
+
<xsl:with-param name="role" select="$role" />
|
295
|
+
<xsl:with-param name="subject" select="$subject"/>
|
296
|
+
</xsl:call-template>
|
297
|
+
<xsl:if test=" $generate-paths = 'true' or $generate-paths= 'yes' ">
|
298
|
+
<!-- true/false is the new way -->
|
299
|
+
<axsl:attribute name="location">
|
300
|
+
<axsl:apply-templates select="." mode="schematron-select-full-path"/>
|
301
|
+
</axsl:attribute>
|
302
|
+
</xsl:if>
|
303
|
+
|
304
|
+
<svrl:text>
|
305
|
+
<xsl:apply-templates mode="text" />
|
306
|
+
|
307
|
+
</svrl:text>
|
308
|
+
<xsl:if test="$diagnose = 'yes' or $diagnose= 'true' ">
|
309
|
+
<!-- true/false is the new way -->
|
310
|
+
<xsl:call-template name="diagnosticsSplit">
|
311
|
+
<xsl:with-param name="str" select="$diagnostics"/>
|
312
|
+
</xsl:call-template>
|
313
|
+
</xsl:if>
|
314
|
+
|
315
|
+
|
316
|
+
<xsl:if test="$property= 'yes' or $property= 'true' ">
|
317
|
+
<!-- true/false is the new way -->
|
318
|
+
<xsl:call-template name="propertiesSplit">
|
319
|
+
<xsl:with-param name="str" select="$properties"/>
|
320
|
+
</xsl:call-template>
|
321
|
+
</xsl:if>
|
322
|
+
|
323
|
+
</svrl:failed-assert>
|
324
|
+
|
325
|
+
|
326
|
+
<xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
|
327
|
+
<axsl:message terminate="yes">TERMINATING</axsl:message>
|
328
|
+
</xsl:if>
|
329
|
+
<xsl:if test=" $terminate = 'assert' ">
|
330
|
+
<axsl:message terminate="yes">TERMINATING</axsl:message>
|
331
|
+
</xsl:if>
|
332
|
+
</xsl:template>
|
333
|
+
|
334
|
+
<xsl:template name="process-report">
|
335
|
+
<xsl:param name="id"/>
|
336
|
+
<xsl:param name="test"/>
|
337
|
+
<xsl:param name="diagnostics"/>
|
338
|
+
<xsl:param name="flag" />
|
339
|
+
<xsl:param name="properties"/>
|
340
|
+
<!-- "Linkable" parameters -->
|
341
|
+
<xsl:param name="role"/>
|
342
|
+
<xsl:param name="subject"/>
|
343
|
+
<!-- "Rich" parameters -->
|
344
|
+
<xsl:param name="fpi" />
|
345
|
+
<xsl:param name="icon" />
|
346
|
+
<xsl:param name="lang" />
|
347
|
+
<xsl:param name="see" />
|
348
|
+
<xsl:param name="space" />
|
349
|
+
<svrl:successful-report test="{$test}" >
|
350
|
+
<xsl:if test=" string-length( $id ) > 0">
|
351
|
+
<axsl:attribute name="id">
|
352
|
+
<xsl:value-of select=" $id " />
|
353
|
+
</axsl:attribute>
|
354
|
+
</xsl:if>
|
355
|
+
<xsl:if test=" string-length( $flag ) > 0">
|
356
|
+
<axsl:attribute name="flag">
|
357
|
+
<xsl:value-of select=" $flag " />
|
358
|
+
</axsl:attribute>
|
359
|
+
</xsl:if>
|
360
|
+
|
361
|
+
<!-- Process rich attributes. -->
|
362
|
+
<xsl:call-template name="richParms">
|
363
|
+
<xsl:with-param name="fpi" select="$fpi"/>
|
364
|
+
<xsl:with-param name="icon" select="$icon"/>
|
365
|
+
<xsl:with-param name="lang" select="$lang"/>
|
366
|
+
<xsl:with-param name="see" select="$see" />
|
367
|
+
<xsl:with-param name="space" select="$space" />
|
368
|
+
</xsl:call-template>
|
369
|
+
<xsl:call-template name='linkableParms'>
|
370
|
+
<xsl:with-param name="role" select="$role" />
|
371
|
+
<xsl:with-param name="subject" select="$subject"/>
|
372
|
+
</xsl:call-template>
|
373
|
+
<xsl:if test=" $generate-paths = 'yes' or $generate-paths = 'true' ">
|
374
|
+
<!-- true/false is the new way -->
|
375
|
+
<axsl:attribute name="location">
|
376
|
+
<axsl:apply-templates select="." mode="schematron-select-full-path"/>
|
377
|
+
</axsl:attribute>
|
378
|
+
</xsl:if>
|
379
|
+
|
380
|
+
<svrl:text>
|
381
|
+
<xsl:apply-templates mode="text" />
|
382
|
+
|
383
|
+
</svrl:text>
|
384
|
+
<xsl:if test="$diagnose = 'yes' or $diagnose='true' ">
|
385
|
+
<!-- true/false is the new way -->
|
386
|
+
<xsl:call-template name="diagnosticsSplit">
|
387
|
+
<xsl:with-param name="str" select="$diagnostics"/>
|
388
|
+
</xsl:call-template>
|
389
|
+
</xsl:if>
|
390
|
+
|
391
|
+
|
392
|
+
<xsl:if test="$property = 'yes' or $property='true' ">
|
393
|
+
<!-- true/false is the new way -->
|
394
|
+
<xsl:call-template name="propertiesSplit">
|
395
|
+
<xsl:with-param name="str" select="$properties"/>
|
396
|
+
</xsl:call-template>
|
397
|
+
</xsl:if>
|
398
|
+
|
399
|
+
|
400
|
+
</svrl:successful-report>
|
401
|
+
|
402
|
+
|
403
|
+
<xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
|
404
|
+
<axsl:message terminate="yes" >TERMINATING</axsl:message>
|
405
|
+
</xsl:if>
|
406
|
+
</xsl:template>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
<xsl:template name="process-diagnostic">
|
412
|
+
<xsl:param name="id"/>
|
413
|
+
<!-- Rich parameters -->
|
414
|
+
<xsl:param name="fpi" />
|
415
|
+
<xsl:param name="icon" />
|
416
|
+
<xsl:param name="lang" />
|
417
|
+
<xsl:param name="see" />
|
418
|
+
<xsl:param name="space" />
|
419
|
+
<svrl:diagnostic-reference diagnostic="{$id}" >
|
420
|
+
<!--xsl:if test="string($id)">
|
421
|
+
<xsl:attribute name="id">
|
422
|
+
<xsl:value-of select="$id"/>
|
423
|
+
</xsl:attribute>
|
424
|
+
</xsl:if-->
|
425
|
+
<xsl:call-template name="richParms">
|
426
|
+
<xsl:with-param name="fpi" select="$fpi"/>
|
427
|
+
<xsl:with-param name="icon" select="$icon"/>
|
428
|
+
<xsl:with-param name="lang" select="$lang"/>
|
429
|
+
<xsl:with-param name="see" select="$see" />
|
430
|
+
<xsl:with-param name="space" select="$space" />
|
431
|
+
</xsl:call-template>
|
432
|
+
<xsl:text>
|
433
|
+
</xsl:text>
|
434
|
+
|
435
|
+
<xsl:apply-templates mode="text"/>
|
436
|
+
|
437
|
+
</svrl:diagnostic-reference>
|
438
|
+
</xsl:template>
|
439
|
+
|
440
|
+
|
441
|
+
<!-- Overrides skeleton -->
|
442
|
+
<xsl:template name="process-dir" >
|
443
|
+
<xsl:param name="value" />
|
444
|
+
<xsl:choose>
|
445
|
+
<xsl:when test=" $allow-foreign = 'true'">
|
446
|
+
<xsl:copy-of select="."/>
|
447
|
+
</xsl:when>
|
448
|
+
|
449
|
+
<xsl:otherwise>
|
450
|
+
<!-- We generate too much whitespace rather than risking concatenation -->
|
451
|
+
<axsl:text> </axsl:text>
|
452
|
+
<xsl:apply-templates mode="inline-text"/>
|
453
|
+
<axsl:text> </axsl:text>
|
454
|
+
</xsl:otherwise>
|
455
|
+
</xsl:choose>
|
456
|
+
</xsl:template>
|
457
|
+
|
458
|
+
|
459
|
+
<!-- Overrides skeleton -->
|
460
|
+
<xsl:template name="process-emph" >
|
461
|
+
<xsl:param name="class" />
|
462
|
+
<xsl:choose>
|
463
|
+
<xsl:when test=" $allow-foreign = 'true'">
|
464
|
+
<xsl:copy-of select="."/>
|
465
|
+
</xsl:when>
|
466
|
+
<xsl:otherwise>
|
467
|
+
<!-- We generate too much whitespace rather than risking concatenation -->
|
468
|
+
<axsl:text> </axsl:text>
|
469
|
+
<xsl:apply-templates mode="inline-text"/>
|
470
|
+
<axsl:text> </axsl:text>
|
471
|
+
</xsl:otherwise>
|
472
|
+
</xsl:choose>
|
473
|
+
</xsl:template>
|
474
|
+
|
475
|
+
<xsl:template name="process-rule">
|
476
|
+
<xsl:param name="id"/>
|
477
|
+
<xsl:param name="context"/>
|
478
|
+
<xsl:param name="flag"/>
|
479
|
+
<xsl:param name="properties" />
|
480
|
+
<!-- "Linkable" parameters -->
|
481
|
+
<xsl:param name="role"/>
|
482
|
+
<xsl:param name="subject"/>
|
483
|
+
<!-- "Rich" parameters -->
|
484
|
+
<xsl:param name="fpi" />
|
485
|
+
<xsl:param name="icon" />
|
486
|
+
<xsl:param name="lang" />
|
487
|
+
<xsl:param name="see" />
|
488
|
+
<xsl:param name="space" />
|
489
|
+
<xsl:if test=" $generate-fired-rule = 'true'">
|
490
|
+
<svrl:fired-rule context="{$context}" >
|
491
|
+
<xsl:if test=" string( $id )">
|
492
|
+
<xsl:attribute name="id">
|
493
|
+
<xsl:value-of select=" $id " />
|
494
|
+
</xsl:attribute>
|
495
|
+
</xsl:if>
|
496
|
+
<xsl:if test=" string-length( $role ) > 0">
|
497
|
+
<xsl:attribute name="role">
|
498
|
+
<xsl:value-of select=" $role " />
|
499
|
+
</xsl:attribute>
|
500
|
+
</xsl:if>
|
501
|
+
<!-- Process rich attributes. -->
|
502
|
+
<xsl:call-template name="richParms">
|
503
|
+
<xsl:with-param name="fpi" select="$fpi"/>
|
504
|
+
<xsl:with-param name="icon" select="$icon"/>
|
505
|
+
<xsl:with-param name="lang" select="$lang"/>
|
506
|
+
<xsl:with-param name="see" select="$see" />
|
507
|
+
<xsl:with-param name="space" select="$space" />
|
508
|
+
</xsl:call-template>
|
509
|
+
|
510
|
+
|
511
|
+
<xsl:if test="$property= 'yes' or $property= 'true' ">
|
512
|
+
<!-- true/false is the new way -->
|
513
|
+
<xsl:call-template name="propertiesSplit">
|
514
|
+
<xsl:with-param name="str" select="$properties"/>
|
515
|
+
</xsl:call-template>
|
516
|
+
</xsl:if>
|
517
|
+
|
518
|
+
</svrl:fired-rule>
|
519
|
+
</xsl:if>
|
520
|
+
</xsl:template>
|
521
|
+
|
522
|
+
<xsl:template name="process-ns">
|
523
|
+
<xsl:param name="prefix"/>
|
524
|
+
<xsl:param name="uri"/>
|
525
|
+
<svrl:ns-prefix-in-attribute-values uri="{$uri}" prefix="{$prefix}" />
|
526
|
+
</xsl:template>
|
527
|
+
|
528
|
+
<xsl:template name="process-p">
|
529
|
+
<xsl:param name="icon"/>
|
530
|
+
<xsl:param name="class"/>
|
531
|
+
<xsl:param name="id"/>
|
532
|
+
<xsl:param name="lang"/>
|
533
|
+
|
534
|
+
<svrl:text>
|
535
|
+
<xsl:apply-templates mode="text"/>
|
536
|
+
</svrl:text>
|
537
|
+
</xsl:template>
|
538
|
+
|
539
|
+
<xsl:template name="process-pattern">
|
540
|
+
<xsl:param name="name"/>
|
541
|
+
<xsl:param name="id"/>
|
542
|
+
<xsl:param name="is-a"/>
|
543
|
+
|
544
|
+
<!-- "Rich" parameters -->
|
545
|
+
<xsl:param name="fpi" />
|
546
|
+
<xsl:param name="icon" />
|
547
|
+
<xsl:param name="lang" />
|
548
|
+
<xsl:param name="see" />
|
549
|
+
<xsl:param name="space" />
|
550
|
+
<svrl:active-pattern >
|
551
|
+
<axsl:attribute name="document">
|
552
|
+
<axsl:value-of select="document-uri(/)" />
|
553
|
+
</axsl:attribute><!-- If XSLT1 remove this -->
|
554
|
+
<xsl:if test=" string( $id )">
|
555
|
+
<axsl:attribute name="id">
|
556
|
+
<xsl:value-of select=" $id " />
|
557
|
+
</axsl:attribute>
|
558
|
+
</xsl:if>
|
559
|
+
<xsl:if test=" string( $name )">
|
560
|
+
<axsl:attribute name="name">
|
561
|
+
<xsl:value-of select=" $name " />
|
562
|
+
</axsl:attribute>
|
563
|
+
</xsl:if>
|
564
|
+
|
565
|
+
<xsl:call-template name='richParms'>
|
566
|
+
<xsl:with-param name="fpi" select="$fpi"/>
|
567
|
+
<xsl:with-param name="icon" select="$icon"/>
|
568
|
+
<xsl:with-param name="lang" select="$lang"/>
|
569
|
+
<xsl:with-param name="see" select="$see" />
|
570
|
+
<xsl:with-param name="space" select="$space" />
|
571
|
+
</xsl:call-template>
|
572
|
+
|
573
|
+
<!-- ?? report that this screws up iso:title processing -->
|
574
|
+
<xsl:apply-templates mode="do-pattern-p"/>
|
575
|
+
<!-- ?? Seems that this apply-templates is never triggered DP -->
|
576
|
+
<axsl:apply-templates />
|
577
|
+
</svrl:active-pattern>
|
578
|
+
</xsl:template>
|
579
|
+
|
580
|
+
<!-- Overrides skeleton -->
|
581
|
+
<xsl:template name="process-message" >
|
582
|
+
<xsl:param name="pattern"/>
|
583
|
+
<xsl:param name="role"/>
|
584
|
+
</xsl:template>
|
585
|
+
|
586
|
+
|
587
|
+
<!-- Overrides skeleton -->
|
588
|
+
<xsl:template name="process-span" >
|
589
|
+
<xsl:param name="class" />
|
590
|
+
<xsl:choose>
|
591
|
+
<xsl:when test=" $allow-foreign = 'true'">
|
592
|
+
<xsl:copy-of select="."/>
|
593
|
+
</xsl:when>
|
594
|
+
<xsl:otherwise>
|
595
|
+
<!-- We generate too much whitespace rather than risking concatenation -->
|
596
|
+
<axsl:text> </axsl:text>
|
597
|
+
<xsl:apply-templates mode="inline-text"/>
|
598
|
+
<axsl:text> </axsl:text>
|
599
|
+
</xsl:otherwise>
|
600
|
+
</xsl:choose>
|
601
|
+
</xsl:template>
|
602
|
+
|
603
|
+
<!-- =========================================================================== -->
|
604
|
+
<!-- processing rich parameters. -->
|
605
|
+
<xsl:template name='richParms'>
|
606
|
+
<!-- "Rich" parameters -->
|
607
|
+
<xsl:param name="fpi" />
|
608
|
+
<xsl:param name="icon" />
|
609
|
+
<xsl:param name="lang" />
|
610
|
+
<xsl:param name="see" />
|
611
|
+
<xsl:param name="space" />
|
612
|
+
<!-- Process rich attributes. -->
|
613
|
+
<xsl:if test=" $allow-foreign = 'true'">
|
614
|
+
<xsl:if test="string($fpi)">
|
615
|
+
<axsl:attribute name="fpi">
|
616
|
+
<xsl:value-of select="$fpi "/>
|
617
|
+
</axsl:attribute>
|
618
|
+
</xsl:if>
|
619
|
+
<xsl:if test="string($icon)">
|
620
|
+
<axsl:attribute name="icon">
|
621
|
+
<xsl:value-of select="$icon"/>
|
622
|
+
</axsl:attribute>
|
623
|
+
</xsl:if>
|
624
|
+
<xsl:if test="string($see)">
|
625
|
+
<axsl:attribute name="see">
|
626
|
+
<xsl:value-of select="$see" />
|
627
|
+
</axsl:attribute>
|
628
|
+
</xsl:if>
|
629
|
+
</xsl:if>
|
630
|
+
<xsl:if test="string($space)">
|
631
|
+
<axsl:attribute name="xml:space">
|
632
|
+
<xsl:value-of select="$space"/>
|
633
|
+
</axsl:attribute>
|
634
|
+
</xsl:if>
|
635
|
+
<xsl:if test="string($lang)">
|
636
|
+
<axsl:attribute name="xml:lang">
|
637
|
+
<xsl:value-of select="$lang"/>
|
638
|
+
</axsl:attribute>
|
639
|
+
</xsl:if>
|
640
|
+
</xsl:template>
|
641
|
+
|
642
|
+
<!-- processing linkable parameters. -->
|
643
|
+
<xsl:template name='linkableParms'>
|
644
|
+
<xsl:param name="role"/>
|
645
|
+
<xsl:param name="subject"/>
|
646
|
+
|
647
|
+
<!-- ISO SVRL has a role attribute to match the Schematron role attribute -->
|
648
|
+
<xsl:if test=" string($role )">
|
649
|
+
<axsl:attribute name="role">
|
650
|
+
<xsl:value-of select=" $role " />
|
651
|
+
</axsl:attribute>
|
652
|
+
</xsl:if>
|
653
|
+
<!-- ISO SVRL does not have a subject attribute to match the Schematron subject attribute.
|
654
|
+
Instead, the Schematron subject attribute is folded into the location attribute -->
|
655
|
+
</xsl:template>
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
<!-- ===================================================== -->
|
660
|
+
<!-- Extension API: -->
|
661
|
+
<!-- This allows the transmission of extra attributes on -->
|
662
|
+
<!-- rules, asserts, reports, diagnostics. -->
|
663
|
+
<!-- ===================================================== -->
|
664
|
+
|
665
|
+
|
666
|
+
<!-- Overrides skeleton EXPERIMENTAL -->
|
667
|
+
<!-- The $contents is for static contents, the $value is for dynamic contents -->
|
668
|
+
<xsl:template name="process-property">
|
669
|
+
<xsl:param name="id"/>
|
670
|
+
<xsl:param name="name"/>
|
671
|
+
<xsl:param name="value"/>
|
672
|
+
<xsl:param name="contents"/>
|
673
|
+
|
674
|
+
<svrl:property id="{$id}" >
|
675
|
+
<xsl:if test="$name">
|
676
|
+
<xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
|
677
|
+
</xsl:if>
|
678
|
+
|
679
|
+
<xsl:if test="$value">
|
680
|
+
<xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
|
681
|
+
</xsl:if>
|
682
|
+
|
683
|
+
<xsl:if test="$contents">
|
684
|
+
<xsl:copy-of select="$contents"/>
|
685
|
+
</xsl:if>
|
686
|
+
|
687
|
+
</svrl:property>
|
688
|
+
</xsl:template>
|
689
|
+
|
690
|
+
|
691
|
+
</xsl:stylesheet>
|
692
|
+
|