simple-xspec-wrapper 0.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +11 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +6 -0
  8. data/Gemfile.lock +37 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +49 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/exe/xspec +16 -0
  15. data/lib/xspec/version.rb +3 -0
  16. data/lib/xspec.rb +256 -0
  17. data/simple-xspec-wrapper.gemspec +28 -0
  18. data/spec-test.xml +1125 -0
  19. data/vendor/xspec-1.0.0/.gitignore +7 -0
  20. data/vendor/xspec-1.0.0/.travis.yml +57 -0
  21. data/vendor/xspec-1.0.0/LICENSE +21 -0
  22. data/vendor/xspec-1.0.0/README.md +26 -0
  23. data/vendor/xspec-1.0.0/appveyor.yml +77 -0
  24. data/vendor/xspec-1.0.0/bin/xspec.bat +620 -0
  25. data/vendor/xspec-1.0.0/bin/xspec.sh +403 -0
  26. data/vendor/xspec-1.0.0/build.xml +369 -0
  27. data/vendor/xspec-1.0.0/editors/emacs/README +31 -0
  28. data/vendor/xspec-1.0.0/editors/emacs/schemas.xml +6 -0
  29. data/vendor/xspec-1.0.0/editors/oxygen/.cvsignore +2 -0
  30. data/vendor/xspec-1.0.0/editors/oxygen/README +11 -0
  31. data/vendor/xspec-1.0.0/editors/oxygen/build.xml +38 -0
  32. data/vendor/xspec-1.0.0/editors/oxygen/templates/xspec.xml +17 -0
  33. data/vendor/xspec-1.0.0/editors/oxygen/xspec.framework +175 -0
  34. data/vendor/xspec-1.0.0/find-examples.xml +37 -0
  35. data/vendor/xspec-1.0.0/find-examples.xsl +615 -0
  36. data/vendor/xspec-1.0.0/graphics/3angle-down.gif +0 -0
  37. data/vendor/xspec-1.0.0/graphics/3angle-right.gif +0 -0
  38. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.class +0 -0
  39. data/vendor/xspec-1.0.0/java/com/jenitennison/xslt/tests/XSLTCoverageTraceListener.java +209 -0
  40. data/vendor/xspec-1.0.0/src/ant/find-test-failure.xsl +17 -0
  41. data/vendor/xspec-1.0.0/src/ant/get-schematron-phase.xsl +17 -0
  42. data/vendor/xspec-1.0.0/src/ant/locate-schematron.xsl +28 -0
  43. data/vendor/xspec-1.0.0/src/ant/make-path.js +4 -0
  44. data/vendor/xspec-1.0.0/src/compiler/generate-common-tests.xsl +604 -0
  45. data/vendor/xspec-1.0.0/src/compiler/generate-query-helper.xsl +152 -0
  46. data/vendor/xspec-1.0.0/src/compiler/generate-query-tests.xsl +473 -0
  47. data/vendor/xspec-1.0.0/src/compiler/generate-query-utils.xql +263 -0
  48. data/vendor/xspec-1.0.0/src/compiler/generate-tests-helper.xsl +169 -0
  49. data/vendor/xspec-1.0.0/src/compiler/generate-tests-utils.xsl +479 -0
  50. data/vendor/xspec-1.0.0/src/compiler/generate-xspec-tests.xsl +503 -0
  51. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-standalone-xquery-harness.xproc +135 -0
  52. data/vendor/xspec-1.0.0/src/harnesses/basex/basex-xquery-harness.xproc +133 -0
  53. data/vendor/xspec-1.0.0/src/harnesses/exist/exist-xquery-harness.xproc +161 -0
  54. data/vendor/xspec-1.0.0/src/harnesses/harness-lib.xpl +327 -0
  55. data/vendor/xspec-1.0.0/src/harnesses/marklogic/ml-xquery-harness.xproc +143 -0
  56. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xquery-harness.xproc +108 -0
  57. data/vendor/xspec-1.0.0/src/harnesses/saxon/saxon-xslt-harness.xproc +85 -0
  58. data/vendor/xspec-1.0.0/src/harnesses/zorba/zorba-xquery-harness.xproc +134 -0
  59. data/vendor/xspec-1.0.0/src/reporter/coverage-report.xsl +378 -0
  60. data/vendor/xspec-1.0.0/src/reporter/format-utils.xsl +220 -0
  61. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report-folding.xsl +164 -0
  62. data/vendor/xspec-1.0.0/src/reporter/format-xspec-report.xsl +410 -0
  63. data/vendor/xspec-1.0.0/src/reporter/junit-report.xsl +93 -0
  64. data/vendor/xspec-1.0.0/src/reporter/test-report.css +469 -0
  65. data/vendor/xspec-1.0.0/src/schemas/find-examples.rnc +90 -0
  66. data/vendor/xspec-1.0.0/src/schemas/xspec.rnc +304 -0
  67. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_abstract_expand.xsl +313 -0
  68. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_dsdl_include.xsl +1519 -0
  69. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message.xsl +64 -0
  70. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_message_xslt2.xsl +64 -0
  71. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_saxon.xsl +2306 -0
  72. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_schematron_skeleton_for_xslt1.xsl +1851 -0
  73. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt1.xsl +614 -0
  74. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/iso_svrl_for_xslt2.xsl +692 -0
  75. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/readme.txt +101 -0
  76. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-cs.xhtml +56 -0
  77. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-de.xhtml +55 -0
  78. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-en.xhtml +57 -0
  79. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-fr.xhtml +54 -0
  80. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-ja.xhtml +53 -0
  81. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/sch-messages-nl.xhtml +58 -0
  82. data/vendor/xspec-1.0.0/src/schematron/iso-schematron/schematron-skeleton-api.htm +723 -0
  83. data/vendor/xspec-1.0.0/src/schematron/sch-location-compare.xsl +139 -0
  84. data/vendor/xspec-1.0.0/src/schematron/schut-to-xspec.xsl +179 -0
  85. data/vendor/xspec-1.0.0/test/Makefile +117 -0
  86. data/vendor/xspec-1.0.0/test/README +5 -0
  87. data/vendor/xspec-1.0.0/test/catalog/xspec-160_catalog.xml +4 -0
  88. data/vendor/xspec-1.0.0/test/catalog/xspec-160_schematron.xspec +6 -0
  89. data/vendor/xspec-1.0.0/test/catalog/xspec-160_xslt.xspec +5 -0
  90. data/vendor/xspec-1.0.0/test/end-to-end/README.md +42 -0
  91. data/vendor/xspec-1.0.0/test/end-to-end/cases/.gitignore +1 -0
  92. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/.gitignore +3 -0
  93. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-50-result-norm.html +74 -0
  94. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-55-result-norm.html +112 -0
  95. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-focus-1-result-norm.html +109 -0
  96. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-function-result-norm.html +118 -0
  97. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-import-result-norm.html +163 -0
  98. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-imported-result-norm.html +95 -0
  99. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-pending-result-norm.html +123 -0
  100. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-rule-result-norm.html +109 -0
  101. data/vendor/xspec-1.0.0/test/end-to-end/cases/expected/xspec-three-dots-result-norm.html +1237 -0
  102. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xsl +7 -0
  103. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-50.xspec +10 -0
  104. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xsl +2 -0
  105. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-55.xspec +18 -0
  106. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-focus-1.xspec +71 -0
  107. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-function.xspec +50 -0
  108. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-import.xspec +50 -0
  109. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-imported.xspec +48 -0
  110. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-pending.xspec +89 -0
  111. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-rule.xspec +76 -0
  112. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xsl +49 -0
  113. data/vendor/xspec-1.0.0/test/end-to-end/cases/xspec-three-dots.xspec +527 -0
  114. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.cmd +51 -0
  115. data/vendor/xspec-1.0.0/test/end-to-end/generate-expected.sh +25 -0
  116. data/vendor/xspec-1.0.0/test/end-to-end/processor/_deserializer.xsl +53 -0
  117. data/vendor/xspec-1.0.0/test/end-to-end/processor/_normalizer.xsl +192 -0
  118. data/vendor/xspec-1.0.0/test/end-to-end/processor/_serializer.xsl +15 -0
  119. data/vendor/xspec-1.0.0/test/end-to-end/processor/_util.xsl +35 -0
  120. data/vendor/xspec-1.0.0/test/end-to-end/processor/compare.xsl +88 -0
  121. data/vendor/xspec-1.0.0/test/end-to-end/processor/normalize.xsl +28 -0
  122. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.cmd +61 -0
  123. data/vendor/xspec-1.0.0/test/end-to-end/run-e2e-tests.sh +28 -0
  124. data/vendor/xspec-1.0.0/test/generate-tests-utils.xspec +636 -0
  125. data/vendor/xspec-1.0.0/test/generate-x-utils.xspec +173 -0
  126. data/vendor/xspec-1.0.0/test/generate-xspec-tests.xspec +64 -0
  127. data/vendor/xspec-1.0.0/test/run-xspec-tests.cmd +83 -0
  128. data/vendor/xspec-1.0.0/test/run-xspec-tests.sh +42 -0
  129. data/vendor/xspec-1.0.0/test/sch-location-compare.xspec +179 -0
  130. data/vendor/xspec-1.0.0/test/schematron/data/standards.xml +7 -0
  131. data/vendor/xspec-1.0.0/test/schematron/schematron-017.sch +9 -0
  132. data/vendor/xspec-1.0.0/test/schematron/schematron-018.sch +17 -0
  133. data/vendor/xspec-1.0.0/test/schematron/schematron-019.sch +13 -0
  134. data/vendor/xspec-1.0.0/test/schematron/schematron-020-01.sch +35 -0
  135. data/vendor/xspec-1.0.0/test/schematron/schematron-020.sch +32 -0
  136. data/vendor/xspec-1.0.0/test/schematron/schematron-021.sch +28 -0
  137. data/vendor/xspec-1.0.0/test/schematron/schematron-022.sch +18 -0
  138. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-compile.xsl +8 -0
  139. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-expand.xsl +8 -0
  140. data/vendor/xspec-1.0.0/test/schematron/schematron-xslt-include.xsl +8 -0
  141. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-in.xspec +5 -0
  142. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-001-out.xspec +7 -0
  143. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-in.xspec +5 -0
  144. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002-out.xspec +7 -0
  145. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-002.sch +4 -0
  146. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-in.xspec +7 -0
  147. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-003-out.xspec +9 -0
  148. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-in.xspec +20 -0
  149. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-004-out.xspec +22 -0
  150. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-in.xspec +6 -0
  151. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-005-out.xspec +8 -0
  152. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-in.xspec +11 -0
  153. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-006-out.xspec +13 -0
  154. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-in.xspec +7 -0
  155. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007-out.xspec +9 -0
  156. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-007.xml +2 -0
  157. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-in.xspec +9 -0
  158. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-008-out.xspec +9 -0
  159. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-import-in.xspec +5 -0
  160. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-in.xspec +6 -0
  161. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-009-out.xspec +10 -0
  162. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-import.xspec +5 -0
  163. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-in.xspec +6 -0
  164. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-010-out.xspec +8 -0
  165. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-in.xspec +6 -0
  166. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-011-out.xspec +8 -0
  167. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-01.xml +4 -0
  168. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-02.xml +13 -0
  169. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-012-out.xspec +81 -0
  170. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-in.xspec +6 -0
  171. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-013-out.xspec +8 -0
  172. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch +4 -0
  173. data/vendor/xspec-1.0.0/test/schematron/schut-to-xspec-test.sch.xsl +4 -0
  174. data/vendor/xspec-1.0.0/test/schematron-01.sch +17 -0
  175. data/vendor/xspec-1.0.0/test/schematron-01.xml +14 -0
  176. data/vendor/xspec-1.0.0/test/schematron-01.xspec +14 -0
  177. data/vendor/xspec-1.0.0/test/schematron-012.xspec +83 -0
  178. data/vendor/xspec-1.0.0/test/schematron-014-01.xml +10 -0
  179. data/vendor/xspec-1.0.0/test/schematron-014.sch +16 -0
  180. data/vendor/xspec-1.0.0/test/schematron-014.xspec +11 -0
  181. data/vendor/xspec-1.0.0/test/schematron-015.sch +16 -0
  182. data/vendor/xspec-1.0.0/test/schematron-015.xspec +11 -0
  183. data/vendor/xspec-1.0.0/test/schematron-016.sch +19 -0
  184. data/vendor/xspec-1.0.0/test/schematron-016.xspec +171 -0
  185. data/vendor/xspec-1.0.0/test/schematron-017.xspec +26 -0
  186. data/vendor/xspec-1.0.0/test/schematron-018.xspec +120 -0
  187. data/vendor/xspec-1.0.0/test/schematron-019.xspec +16 -0
  188. data/vendor/xspec-1.0.0/test/schematron-020.xspec +53 -0
  189. data/vendor/xspec-1.0.0/test/schematron-021.xspec +27 -0
  190. data/vendor/xspec-1.0.0/test/schematron-022.xspec +15 -0
  191. data/vendor/xspec-1.0.0/test/schematron-param-001.xspec +50 -0
  192. data/vendor/xspec-1.0.0/test/schut-to-xspec-012.sch +27 -0
  193. data/vendor/xspec-1.0.0/test/schut-to-xspec.xspec +85 -0
  194. data/vendor/xspec-1.0.0/test/unit-expect-xsl.xspec +28 -0
  195. data/vendor/xspec-1.0.0/test/xspec-26.xsl +19 -0
  196. data/vendor/xspec-1.0.0/test/xspec-26.xspec +17 -0
  197. data/vendor/xspec-1.0.0/test/xspec-30.xml +2 -0
  198. data/vendor/xspec-1.0.0/test/xspec-30.xsl +6 -0
  199. data/vendor/xspec-1.0.0/test/xspec-30.xspec +8 -0
  200. data/vendor/xspec-1.0.0/test/xspec-33.xsl +7 -0
  201. data/vendor/xspec-1.0.0/test/xspec-33.xspec +15 -0
  202. data/vendor/xspec-1.0.0/test/xspec-46.xsl +7 -0
  203. data/vendor/xspec-1.0.0/test/xspec-46.xspec +9 -0
  204. data/vendor/xspec-1.0.0/test/xspec-72.xsl +13 -0
  205. data/vendor/xspec-1.0.0/test/xspec-72.xspec +19 -0
  206. data/vendor/xspec-1.0.0/test/xspec-bat.cmd +757 -0
  207. data/vendor/xspec-1.0.0/test/xspec-focus-2.xspec +91 -0
  208. data/vendor/xspec-1.0.0/test/xspec-junit.xspec +78 -0
  209. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xml +1003 -0
  210. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xslt +10 -0
  211. data/vendor/xspec-1.0.0/test/xspec-result-naming-collision.xspec +13 -0
  212. data/vendor/xspec-1.0.0/test/xspec-tested.xql +44 -0
  213. data/vendor/xspec-1.0.0/test/xspec-tested.xsl +64 -0
  214. data/vendor/xspec-1.0.0/test/xspec-variable.xml +3 -0
  215. data/vendor/xspec-1.0.0/test/xspec-variable.xspec +58 -0
  216. data/vendor/xspec-1.0.0/test/xspec-xslt3.xsl +13 -0
  217. data/vendor/xspec-1.0.0/test/xspec-xslt3.xspec +12 -0
  218. data/vendor/xspec-1.0.0/test/xspec.bats +420 -0
  219. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xslt +40 -0
  220. data/vendor/xspec-1.0.0/tutorial/escape-for-regex.xspec +75 -0
  221. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.sch +17 -0
  222. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xml +11 -0
  223. data/vendor/xspec-1.0.0/tutorial/schematron/demo-01.xspec +14 -0
  224. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseA.xspec +11 -0
  225. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-PhaseB.xspec +12 -0
  226. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import1.xspec +10 -0
  227. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import2.xspec +8 -0
  228. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02-import3.xspec +10 -0
  229. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.sch +58 -0
  230. data/vendor/xspec-1.0.0/tutorial/schematron/demo-02.xml +19 -0
  231. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc1.xml +6 -0
  232. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03-doc2.xml +7 -0
  233. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.sch +29 -0
  234. data/vendor/xspec-1.0.0/tutorial/schematron/demo-03.xspec +63 -0
  235. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.sch +20 -0
  236. data/vendor/xspec-1.0.0/tutorial/schematron/demo-04.xspec +33 -0
  237. data/vendor/xspec-1.0.0/tutorial/schematron/quickfix.sch +81 -0
  238. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xq +8 -0
  239. data/vendor/xspec-1.0.0/tutorial/xquery-tutorial.xspec +16 -0
  240. data/vendor/xspec-1.0.0/xproject/project.xml +8 -0
  241. data/vendor/xspec-1.0.0/xproject/release-project.xsl +41 -0
  242. metadata +341 -0
@@ -0,0 +1,173 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: test/generate-x-utils.xspec -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Tags: -->
6
+ <!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
7
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
8
+ <t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
9
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
10
+ xmlns:test="http://www.jenitennison.com/xslt/unit-test"
11
+ query="http://www.jenitennison.com/xslt/unit-test"
12
+ query-at="../src/compiler/generate-query-utils.xql"
13
+ stylesheet="../src/compiler/generate-tests-utils.xsl">
14
+
15
+ <!--
16
+ Test the source files generate-tests-utils.xsl and generate-query-utils.xql.
17
+ -->
18
+
19
+ <!--
20
+ Function test:deep-equal($seq1, $seq2).
21
+ -->
22
+ <t:scenario label="test:deep-equal($seq1, $seq2)">
23
+
24
+ <t:scenario label="Identical Sequences">
25
+ <t:call function="test:deep-equal">
26
+ <t:param select="1, 2"/>
27
+ <t:param select="1, 2"/>
28
+ </t:call>
29
+ <t:expect label="the result" test="$x:result eq true()"/>
30
+ </t:scenario>
31
+
32
+ <t:scenario label="Non-Identical Sequences">
33
+ <t:call function="test:deep-equal">
34
+ <t:param select="1, 2"/>
35
+ <t:param select="1, 3"/>
36
+ </t:call>
37
+ <t:expect label="the result" test="$x:result eq false()"/>
38
+ </t:scenario>
39
+
40
+ <t:scenario label="Sequences with Same Items in Different Orders">
41
+ <t:call function="test:deep-equal">
42
+ <t:param select="1, 2"/>
43
+ <t:param select="2, 1"/>
44
+ </t:call>
45
+ <t:expect label="the result" test="$x:result eq false()"/>
46
+ </t:scenario>
47
+
48
+ <t:scenario label="Empty Sequences">
49
+ <t:call function="test:deep-equal">
50
+ <t:param select="()"/>
51
+ <t:param select="()"/>
52
+ </t:call>
53
+ <t:expect label="the result" test="$x:result eq true()"/>
54
+ </t:scenario>
55
+
56
+ <t:scenario label="One empty sequence">
57
+ <t:call function="test:deep-equal">
58
+ <t:param select="()"/>
59
+ <t:param select="1"/>
60
+ </t:call>
61
+ <t:expect label="the result" test="$x:result eq false()"/>
62
+ </t:scenario>
63
+
64
+ <t:scenario label="A text node and several text nodes">
65
+ <t:variable name="elems" as="element()+">
66
+ <e>foo</e>
67
+ <e>bar</e>
68
+ </t:variable>
69
+ <t:call function="test:deep-equal">
70
+ <t:param as="text()">foobar</t:param>
71
+ <t:param select="$elems/text()"/>
72
+ </t:call>
73
+ <t:expect label="the result" test="$x:result eq true()"/>
74
+ </t:scenario>
75
+
76
+ </t:scenario>
77
+
78
+ <!--
79
+ Function test:node-deep-equal($seq1, $seq2).
80
+ -->
81
+ <t:scenario label="test:node-deep-equal($seq1, $seq2)">
82
+
83
+ <t:scenario label="Identical Element Sequences">
84
+ <t:call function="test:node-deep-equal">
85
+ <t:param name="node1">foobar</t:param>
86
+ <t:param name="node2">foobar</t:param>
87
+ </t:call>
88
+ <t:expect label="the result" test="$x:result eq true()"/>
89
+ </t:scenario>
90
+
91
+ </t:scenario>
92
+
93
+ <!--
94
+ Function test:item-deep-equal
95
+ -->
96
+ <t:scenario label="test:item-deep-equal">
97
+
98
+ <t:scenario label="Copy of https://github.com/xspec/xspec/blob/120b3316aef2c1106287dc7c5270f3ed49062c68/src/compiler/generate-tests-utils.xsl#L207-L227">
99
+
100
+ <t:scenario label="Identical Integers">
101
+ <t:call function="test:item-deep-equal">
102
+ <t:param name="item1" select="1" />
103
+ <t:param name="item2" select="1" />
104
+ </t:call>
105
+ <t:expect label="True" select="true()" />
106
+ </t:scenario>
107
+
108
+ <t:scenario label="Non-Identical Strings">
109
+ <t:call function="test:item-deep-equal">
110
+ <t:param name="item1" select="'abc'" />
111
+ <t:param name="item2" select="'def'" />
112
+ </t:call>
113
+ <t:expect label="False" select="false()" />
114
+ </t:scenario>
115
+
116
+ <t:scenario label="String and Integer">
117
+ <t:call function="test:item-deep-equal">
118
+ <t:param name="item1" select="'1'" />
119
+ <t:param name="item2" select="1" />
120
+ </t:call>
121
+ <t:expect label="False" select="false()" />
122
+ </t:scenario>
123
+
124
+ </t:scenario>
125
+
126
+ </t:scenario>
127
+
128
+ <!--
129
+ Function test:report-atomic-value
130
+ -->
131
+ <t:scenario label="test:report-atomic-value">
132
+
133
+ <t:scenario label="Copy of https://github.com/xspec/xspec/blob/8931b371bd619feeeee25bd7014d8a677ab88505/src/compiler/generate-tests-utils.xsl#L622-L629">
134
+ <t:scenario label="String Containing Single Quotes">
135
+ <t:call function="test:report-atomic-value">
136
+ <t:param select="'don''t'" />
137
+ </t:call>
138
+ <t:expect label="Escaped" select="'''don''''t'''" />
139
+ </t:scenario>
140
+ </t:scenario>
141
+
142
+ </t:scenario>
143
+
144
+ </t:description>
145
+
146
+
147
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
148
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
149
+ <!-- -->
150
+ <!-- Copyright (c) 2010 Jeni Tennsion -->
151
+ <!-- -->
152
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
153
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
154
+ <!-- -->
155
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
156
+ <!-- a copy of this software and associated documentation files (the -->
157
+ <!-- "Software"), to deal in the Software without restriction, including -->
158
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
159
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
160
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
161
+ <!-- the following conditions: -->
162
+ <!-- -->
163
+ <!-- The above copyright notice and this permission notice shall be -->
164
+ <!-- included in all copies or substantial portions of the Software. -->
165
+ <!-- -->
166
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
167
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
168
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
169
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
170
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
171
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
172
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
173
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: test/generate-xspec-tests.xspec -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Tags: -->
6
+ <!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
7
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
8
+ <t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" stylesheet="../src/compiler/generate-xspec-tests.xsl">
9
+ <!--
10
+ Test the source file generate-xspec-tests.xsl.
11
+ -->
12
+ <t:scenario label="test:deep-equal($seq1, $seq2)">
13
+ <!--
14
+ <t:scenario label="FIRST TEST.......">
15
+ <t:variable name="ctxt" as="document-node()">
16
+ <t:description>
17
+ <t:scenario/>
18
+ </t:description>
19
+ </t:variable>
20
+ <t:apply select="$ctxt"/>
21
+ <t:expect label="the result" test="$t:result instance of document-node()"/>
22
+ </t:scenario>
23
+ -->
24
+ <t:scenario label="FIRST TEST.......">
25
+ <t:context mode="t:compile">
26
+ <t:scenario label="my label"/>
27
+ </t:context>
28
+ <t:expect label="is a template" test="$t:result instance of element(xsl:template)"/>
29
+ <!-- test also it is a QName in the namespace x:* -->
30
+ <t:expect label="the name" test="exists($t:result/@name)"/>
31
+ <t:expect label="the name is a QName" test=" namespace-uri-from-QName(resolve-QName($t:result/@name, $t:result)) eq 'http://www.jenitennison.com/xslt/xspec'"/>
32
+ <t:expect label="the label message" test="$t:result/xsl:message eq 'my label'"/>
33
+ <t:expect label="the scenario" test="exists($t:result/t:scenario)"/>
34
+ <t:expect label="the scenario label" test="$t:result/t:scenario/t:label eq 'my label'"/>
35
+ </t:scenario>
36
+ </t:scenario>
37
+ </t:description>
38
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
39
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
40
+ <!-- -->
41
+ <!-- Copyright (c) 2010 Jeni Tennsion -->
42
+ <!-- -->
43
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
44
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
45
+ <!-- -->
46
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
47
+ <!-- a copy of this software and associated documentation files (the -->
48
+ <!-- "Software"), to deal in the Software without restriction, including -->
49
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
50
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
51
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
52
+ <!-- the following conditions: -->
53
+ <!-- -->
54
+ <!-- The above copyright notice and this permission notice shall be -->
55
+ <!-- included in all copies or substantial portions of the Software. -->
56
+ <!-- -->
57
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
58
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
59
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
60
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
61
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
62
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
63
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
64
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,83 @@
1
+ @echo off
2
+
3
+ rem ============================================================================
4
+ rem
5
+ rem DESCRIPTION: This script is a Windows version of run-xspec-tests.sh
6
+ rem See run-xspec-tests.sh for details
7
+ rem
8
+ rem DEPENDENCIES: This script does *not* need to be run from the current directory (i.e. the test directory)
9
+ rem
10
+ rem ============================================================================
11
+
12
+ rem
13
+ rem Begin localization of environment changes.
14
+ rem Also make sure the command processor extensions are enabled.
15
+ rem
16
+ verify other 2> NUL
17
+ setlocal enableextensions
18
+ if errorlevel 1 (
19
+ echo Unable to enable extensions
20
+ exit /b %ERRORLEVEL%
21
+ )
22
+
23
+ rem
24
+ rem Go to the directory where this script resides
25
+ rem
26
+ pushd "%~dp0"
27
+
28
+ rem
29
+ rem Result log
30
+ rem
31
+ set RESULT_FILE=result.log
32
+
33
+ rem
34
+ rem Run tests
35
+ rem
36
+ for %%I in (*.xspec) do (
37
+ if /i "%APPVEYOR%"=="True" appveyor AddTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Running
38
+
39
+ rem
40
+ rem Run
41
+ rem
42
+ call :is_schematron "%%~nI"
43
+ if errorlevel 1 (
44
+ "%COMSPEC%" /c ..\bin\xspec.bat -s "%%~I" > "%RESULT_FILE%" 2>&1
45
+ ) else (
46
+ "%COMSPEC%" /c ..\bin\xspec.bat "%%~I" > "%RESULT_FILE%" 2>&1
47
+ )
48
+
49
+ rem
50
+ rem Inspect result
51
+ rem
52
+ ( findstr /r /c:".*failed: [1-9]" "%RESULT_FILE%" || findstr /r /c:"\*\** Error [a-z][a-z]*ing the test suite" "%RESULT_FILE%" || findstr /r /c:"\*\** Error .*Schematron" "%RESULT_FILE%" ) > NUL
53
+ if not errorlevel 1 (
54
+ echo FAILED: %%~I
55
+ echo ---------- "%RESULT_FILE%"
56
+ type "%RESULT_FILE%"
57
+ echo ----------
58
+ if /i "%APPVEYOR%"=="True" appveyor UpdateTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Failed -Duration 0
59
+ exit /b 1
60
+ ) else (
61
+ echo OK: %%~I
62
+ if /i "%APPVEYOR%"=="True" appveyor UpdateTest "%%~I" -Framework custom -Filename "%~nx0" -Outcome Passed -Duration 0
63
+ )
64
+ )
65
+
66
+ rem
67
+ rem Go back to the initial directory
68
+ rem
69
+ popd
70
+
71
+ rem
72
+ rem Exit as success
73
+ rem
74
+ exit /b 0
75
+
76
+ :is_schematron
77
+ set var=%~1
78
+ if "%var:~0,10%"=="schematron" (
79
+ set IS_SCHEMATRON=1
80
+ ) else (
81
+ set IS_SCHEMATRON=0
82
+ )
83
+ exit /b %IS_SCHEMATRON%
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+ #===============================================================================
3
+ #
4
+ # USAGE: ./run-xspec.tests.sh
5
+ #
6
+ # DESCRIPTION: This script is a runner for XSpec test suite inside test directory
7
+ # it runs all the tests with extension .xspec in the test directory
8
+ # it outputs stdout and stderr into a file result.log
9
+ # it greps for failing tests in the log file or for compilation errors
10
+ # it returns no output if the tests are successful
11
+ # or an error message if there are failing tests or compilation errors
12
+ #
13
+ # INPUT: N/A
14
+ #
15
+ # OUTPUT: Error message if there are failing tests or compilation errors
16
+ # A log file is created at result.log
17
+ #
18
+ # DEPENDENCIES: This script must be run from the current directory (i.e. the test directory)
19
+ #
20
+ # AUTHORS: Sandro Cirulli, github.com/cirulls
21
+ # Tobias Fischer, github.com/tofi86
22
+ #
23
+ # LICENSE: MIT License
24
+ #
25
+ #===============================================================================
26
+ for xspectest in *.xspec
27
+ do
28
+ if test "${xspectest:0:10}" = "schematron"; then
29
+ ../bin/xspec.sh -s $xspectest &> result.log;
30
+ else
31
+ ../bin/xspec.sh $xspectest &> result.log;
32
+ fi
33
+ if grep -q ".*failed:\s[1-9]" result.log || grep -q -E "\*+\sError\s(.*Schematron.*|(running|compiling)\sthe\stest\ssuite)" result.log;
34
+ then
35
+ echo "FAILED: $xspectest";
36
+ echo "---------- result.log";
37
+ cat result.log;
38
+ echo "----------";
39
+ exit 1;
40
+ else echo "OK: $xspectest";
41
+ fi
42
+ done
@@ -0,0 +1,179 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="../src/schematron/sch-location-compare.xsl">
3
+
4
+ <x:scenario label="schematron-location-compare" xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
5
+
6
+ <x:scenario label="expand xpath2 svrl">
7
+ <x:scenario label="replace namespace uri with prefix (e.g. 2 namespaces 4 elements)">
8
+ <x:call function="x:schematron-location-expand-xpath2">
9
+ <x:param name="location" select="failed-assert/@location">
10
+ <failed-assert location="/root[1]/*:sec[namespace-uri()='http://example.com/ns1'][2]/*:para[namespace-uri()='http://example.com/ns2'][2]/*:para[namespace-uri()='http://example.com/ns2'][3]"/>
11
+ </x:param>
12
+ <x:param name="namespaces">
13
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
14
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
15
+ </x:param>
16
+ </x:call>
17
+ <x:expect label="namespace prefixes applied" select="'/root[1]/ex1:sec[2]/ex2:para[2]/ex2:para[3]'"/>
18
+ </x:scenario>
19
+ </x:scenario>
20
+
21
+ <x:scenario label="expand xpath1 svrl">
22
+ <x:scenario label="remove wildcard namespace (e.g. 3 elements)">
23
+ <x:call function="x:schematron-location-expand-xpath1">
24
+ <x:param name="location" select="successful-report/@location">
25
+ <successful-report location="/root/*[local-name()='sec'][2]/*[local-name()='para'][2]"/>
26
+ </x:param>
27
+ </x:call>
28
+ <x:expect label="namespace wildcard removed" select="'/root/sec[2]/para[2]'"/>
29
+ </x:scenario>
30
+ </x:scenario>
31
+
32
+ <x:scenario label="expand xpath1 expect">
33
+ <x:scenario label="if no xpath1 style namespace in path return same">
34
+ <x:call function="x:schematron-location-expand-xpath1-expect">
35
+ <x:param name="expect-location">/ex1:section</x:param>
36
+ <x:param name="svrl-location">/section[1]</x:param>
37
+ <x:param name="namespaces">
38
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
39
+ </x:param>
40
+ </x:call>
41
+ <x:expect label="same" select="'/ex1:section'"/>
42
+ </x:scenario>
43
+ <x:scenario label="if xpath1 style namespace in path remove prefixes">
44
+ <x:call function="x:schematron-location-expand-xpath1-expect">
45
+ <x:param name="expect-location">/root/ex1:sec/ex1:sec/ex2:para</x:param>
46
+ <x:param name="svrl-location">/root/*[local-name()='sec'][2]/*[local-name()='sec'][2]/*[local-name()='para'][2]</x:param>
47
+ <x:param name="namespaces">
48
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
49
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
50
+ </x:param>
51
+ </x:call>
52
+ <x:expect label="namespace prefixes removed" select="'/root/sec/sec/para'"/>
53
+ </x:scenario>
54
+ </x:scenario>
55
+
56
+ <x:scenario label="expand attributes">
57
+ <x:call function="x:schematron-location-expand-attributes">
58
+ <x:param name="location">@*[namespace-uri()='http://example.com/ns2' and local-name()='type']</x:param>
59
+ <x:param name="namespaces">
60
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
61
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
62
+ </x:param>
63
+ </x:call>
64
+ <x:expect label="namespace prefix applied" select="'@ex2:type'"/>
65
+ </x:scenario>
66
+
67
+ <x:scenario label="compare">
68
+
69
+ <x:scenario label="match exact">
70
+ <x:call function="x:schematron-location-compare">
71
+ <x:param name="expect-location">/article[1]/section[2]</x:param>
72
+ <x:param name="svrl-location">/article[1]/section[2]</x:param>
73
+ <x:param name="namespaces"/>
74
+ </x:call>
75
+ <x:expect label="true" select="true()"/>
76
+ </x:scenario>
77
+
78
+ <x:scenario label="match ignoring [1]">
79
+ <x:call function="x:schematron-location-compare">
80
+ <x:param name="expect-location">/article/section[2]</x:param>
81
+ <x:param name="svrl-location">/article[1]/section[2]</x:param>
82
+ <x:param name="namespaces"/>
83
+ </x:call>
84
+ <x:expect label="true" select="true()"/>
85
+ </x:scenario>
86
+
87
+ <x:scenario label="match ignoring leading /">
88
+ <x:call function="x:schematron-location-compare">
89
+ <x:param name="expect-location">article[1]/section[2]</x:param>
90
+ <x:param name="svrl-location">/article[1]/section[2]</x:param>
91
+ <x:param name="namespaces"/>
92
+ </x:call>
93
+ <x:expect label="true" select="true()"/>
94
+ </x:scenario>
95
+
96
+ <x:scenario label="match with namespaces xpath1">
97
+ <x:call function="x:schematron-location-compare">
98
+ <x:param name="expect-location">/root/ex1:sec[2]/ex2:para[2]</x:param>
99
+ <x:param name="svrl-location">/root/*[local-name()='sec'][2]/*[local-name()='para'][2]</x:param>
100
+ <x:param name="namespaces">
101
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
102
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
103
+ </x:param>
104
+ </x:call>
105
+ <x:expect label="true" select="true()"/>
106
+ </x:scenario>
107
+
108
+ <x:scenario label="match with namespaces xpath2">
109
+ <x:call function="x:schematron-location-compare">
110
+ <x:param name="expect-location">/root/ex1:sec[2]/ex2:para[2]</x:param>
111
+ <x:param name="svrl-location">/root[1]/*:sec[namespace-uri()='http://example.com/ns1'][2]/*:para[namespace-uri()='http://example.com/ns2'][2]</x:param>
112
+ <x:param name="namespaces">
113
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
114
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
115
+ </x:param>
116
+ </x:call>
117
+ <x:expect label="true" select="true()"/>
118
+ </x:scenario>
119
+
120
+ <x:scenario label="match with attribute (note: outside of oXygen, Schematron does not appear to fire on rules that have an attribute node as context)">
121
+ <x:scenario label="not in namespace">
122
+ <x:call function="x:schematron-location-compare">
123
+ <x:param name="expect-location">/article/section[1]/@type</x:param>
124
+ <x:param name="svrl-location">/article[1]/section[1]/@type</x:param>
125
+ <x:param name="namespaces"/>
126
+ </x:call>
127
+ <x:expect label="true" select="true()"/>
128
+ </x:scenario>
129
+ <x:scenario label="in namespace">
130
+ <x:call function="x:schematron-location-compare">
131
+ <x:param name="expect-location">/ex1:article[1]/ex1:sec[2]/@ex2:type</x:param>
132
+ <x:param name="svrl-location">/*:article[namespace-uri()='http://example.com/ns1'][1]/*:sec[namespace-uri()='http://example.com/ns1'][2]/@*[namespace-uri()='http://example.com/ns2' and local-name()='type']</x:param>
133
+ <x:param name="namespaces">
134
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
135
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
136
+ </x:param>
137
+ </x:call>
138
+ <x:expect label="true" select="true()"/>
139
+ </x:scenario>
140
+ </x:scenario>
141
+
142
+ <x:scenario label="not match">
143
+ <x:call function="x:schematron-location-compare">
144
+ <x:param name="expect-location">/root/body/div/para</x:param>
145
+ <x:param name="svrl-location">/root[1]/div[1]/para[1]</x:param>
146
+ <x:param name="namespaces"/>
147
+ </x:call>
148
+ <x:expect label="false" select="false()"/>
149
+ </x:scenario>
150
+
151
+ <x:scenario label="not match with namespaces xpath1">
152
+ <x:call function="x:schematron-location-compare">
153
+ <x:param name="expect-location">/root/ex1:sec[2]/ex2:para</x:param>
154
+ <x:param name="svrl-location">/root/*[local-name()='sec'][2]</x:param>
155
+ <x:param name="namespaces">
156
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
157
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
158
+ </x:param>
159
+ </x:call>
160
+ <x:expect label="false" select="false()"/>
161
+ </x:scenario>
162
+
163
+ <x:scenario label="not match with namespaces xpath2">
164
+ <x:call function="x:schematron-location-compare">
165
+ <x:param name="expect-location">/root/ex1:sec[2]/ex1:sec[1]/ex2:para[2]</x:param>
166
+ <x:param name="svrl-location">/root[1]/*:sec[namespace-uri()='http://example.com/ns1'][2]/*:para[namespace-uri()='http://example.com/ns2'][2]</x:param>
167
+ <x:param name="namespaces">
168
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns1" prefix="ex1"/>
169
+ <svrl:ns-prefix-in-attribute-values uri="http://example.com/ns2" prefix="ex2"/>
170
+ </x:param>
171
+ </x:call>
172
+ <x:expect label="false" select="false()"/>
173
+ </x:scenario>
174
+
175
+ </x:scenario>
176
+
177
+ </x:scenario>
178
+
179
+ </x:description>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <list>
3
+ <item>XML</item>
4
+ <item>XSLT</item>
5
+ <item>XQuery</item>
6
+ <item>Schematron</item>
7
+ </list>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
3
+ <sch:pattern>
4
+ <sch:let name="list" value="doc('data/standards.xml')/list/item/text()"/>
5
+ <sch:rule context="standard">
6
+ <sch:assert test="text() = $list" id="t1">"<sch:value-of select="text()"/> is not in the list of standards.</sch:assert>
7
+ </sch:rule>
8
+ </sch:pattern>
9
+ </sch:schema>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
3
+ <sch:pattern>
4
+ <sch:rule context="para" id="r1">
5
+ <sch:assert test="true()"/>
6
+ </sch:rule>
7
+ <sch:rule context="section" id="r2">
8
+ <sch:assert test="true()"/>
9
+ </sch:rule>
10
+ <sch:rule context="title[position() eq 1]" id="r3">
11
+ <sch:assert test="true()"/>
12
+ </sch:rule>
13
+ <sch:rule context="title[position() gt 1]" id="r4">
14
+ <sch:assert test="true()"/>
15
+ </sch:rule>
16
+ </sch:pattern>
17
+ </sch:schema>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
3
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
+
5
+ <sch:ns uri="example" prefix="e"/>
6
+
7
+ <xsl:function name="e:add" as="xs:integer">
8
+ <xsl:param name="a" as="xs:integer"/>
9
+ <xsl:param name="b" as="xs:integer"/>
10
+ <xsl:value-of select="$a + $b"/>
11
+ </xsl:function>
12
+
13
+ </sch:schema>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
3
+ <sch:pattern id="include1-pattern1">
4
+ <sch:rule context="para" id="include1-rule1">
5
+ <sch:assert test="false()" id="include1-assert1"/>
6
+ </sch:rule>
7
+ </sch:pattern>
8
+ <sch:pattern id="include1-pattern2">
9
+ <sch:rule context="para" id="include1-rule2">
10
+ <sch:assert test="false()"/>
11
+ </sch:rule>
12
+ </sch:pattern>
13
+ <sch:pattern id="include1-pattern3">
14
+ <sch:rule context="para">
15
+ <sch:assert test="false()"/>
16
+ </sch:rule>
17
+ </sch:pattern>
18
+ <!-- *********************************** -->
19
+ <sch:pattern id="include1-pattern4">
20
+ <sch:rule context="para" id="include1-rule4">
21
+ <sch:assert test="false()" id="include1-assert4"/>
22
+ </sch:rule>
23
+ </sch:pattern>
24
+ <sch:pattern id="include1-pattern5">
25
+ <sch:rule context="para" id="include1-rule5">
26
+ <sch:assert test="false()"/>
27
+ </sch:rule>
28
+ </sch:pattern>
29
+ <!-- *********************************** -->
30
+ <sch:pattern id="include1-pattern6">
31
+ <sch:rule context="para" id="include1-rule6">
32
+ <sch:assert test="false()" id="include1-assert6"/>
33
+ </sch:rule>
34
+ </sch:pattern>
35
+ </sch:schema>