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,133 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: basex-xquery-harness.xproc -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Date: 2011-08-30 -->
6
+ <!-- URI: http://xspec.googlecode.com/ -->
7
+ <!-- Tags: -->
8
+ <!-- Copyright (c) 2011 Florent Georges (see end of file.) -->
9
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
10
+ <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:pkg="http://expath.org/ns/pkg" pkg:import-uri="http://www.jenitennison.com/xslt/xspec/basex/harness/xquery.xproc" name="basex-xquery-harness" type="t:basex-xquery-harness" version="1.0">
11
+ <p:documentation>
12
+ <p>This pipeline executes an XSpec test suite with BaseX standalone.</p>
13
+ <p><b>Primary input:</b> A XSpec test suite document.</p>
14
+ <p><b>Primary output:</b> A formatted HTML XSpec report.</p>
15
+ <p>The dir where you unzipped the XSpec archive on your filesystem is passed
16
+ in the option 'xspec-home'. The compiled test suite (the XQuery file to be
17
+ actually evaluated) is saved on the filesystem to be passed to BaseX. The
18
+ name of this file is passed in the option 'compiled-file' (it defaults to a
19
+ file in /tmp).</p>
20
+ </p:documentation>
21
+
22
+ <p:serialization port="result" indent="true" method="xhtml" encoding="UTF-8" include-content-type="true"/>
23
+
24
+ <p:option name="xspec-home" required="true"/>
25
+ <p:option name="basex-jar" required="true"/>
26
+ <!-- TODO: Use a robust way to get a tmp file name from the OS... -->
27
+ <p:option name="compiled-file" select="'file:/tmp/xspec-basex-compiled-suite.xq'"/>
28
+ <!-- TODO: Use the absolute URIs through the EXPath Packaging System. -->
29
+ <p:variable name="compiler" select="resolve-uri('src/compiler/generate-query-tests.xsl', $xspec-home)"/>
30
+ <p:variable name="formatter" select="resolve-uri('src/reporter/format-xspec-report.xsl', $xspec-home)"/>
31
+ <p:variable name="utils-lib" select="resolve-uri('src/compiler/generate-query-utils.xql', $xspec-home)"/>
32
+
33
+ <p:string-replace match="xsl:import/@href" name="compiler">
34
+ <p:with-option name="replace" select="concat('''', $compiler, '''')"/>
35
+ <p:input port="source">
36
+ <p:inline>
37
+ <xsl:stylesheet version="2.0">
38
+ <xsl:import href="..."/>
39
+ <xsl:template match="/">
40
+ <c:query>
41
+ <xsl:call-template name="t:generate-tests"/>
42
+ </c:query>
43
+ </xsl:template>
44
+ </xsl:stylesheet>
45
+ </p:inline>
46
+ </p:input>
47
+ </p:string-replace>
48
+
49
+ <p:xslt name="compile">
50
+ <p:input port="source">
51
+ <p:pipe step="basex-xquery-harness" port="source"/>
52
+ </p:input>
53
+ <p:input port="stylesheet">
54
+ <p:pipe step="compiler" port="result"/>
55
+ </p:input>
56
+ <p:with-param name="utils-library-at" select="$utils-lib"/>
57
+ </p:xslt>
58
+
59
+ <p:escape-markup name="escape"/>
60
+
61
+ <p:store method="text">
62
+ <p:with-option name="href" select="$compiled-file"/>
63
+ </p:store>
64
+
65
+ <!-- rely on a script 'basex' being in the PATH -->
66
+ <!--p:exec command="basex" name="run">
67
+ <p:with-option name="args" select="$compiled-file"/>
68
+ <p:input port="source">
69
+ <p:empty/>
70
+ </p:input>
71
+ </p:exec-->
72
+ <p:exec command="java" name="run">
73
+ <p:with-option name="args" select="string-join(('-cp', $basex-jar, 'org.basex.BaseX', $compiled-file),' ')"/>
74
+ <p:input port="source">
75
+ <p:empty/>
76
+ </p:input>
77
+ </p:exec>
78
+
79
+ <p:choose>
80
+ <p:when test="exists(/c:result/t:report)">
81
+ <p:load name="formatter">
82
+ <p:with-option name="href" select="$formatter"/>
83
+ </p:load>
84
+ <p:unwrap name="unwrap" match="/c:result">
85
+ <p:input port="source">
86
+ <p:pipe step="run" port="result"/>
87
+ </p:input>
88
+ </p:unwrap>
89
+ <p:xslt name="format-report">
90
+ <p:input port="source">
91
+ <p:pipe step="unwrap" port="result"/>
92
+ </p:input>
93
+ <p:input port="stylesheet">
94
+ <p:pipe step="formatter" port="result"/>
95
+ </p:input>
96
+ </p:xslt>
97
+ </p:when>
98
+ <p:otherwise>
99
+ <p:error code="t:ERR001">
100
+ <p:input port="source">
101
+ <p:pipe step="run" port="result"/>
102
+ </p:input>
103
+ </p:error>
104
+ </p:otherwise>
105
+ </p:choose>
106
+ </p:pipeline>
107
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
108
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
109
+ <!-- -->
110
+ <!-- Copyright (c) 2008, 2010 Jeni Tennison -->
111
+ <!-- -->
112
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
113
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
114
+ <!-- -->
115
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
116
+ <!-- a copy of this software and associated documentation files (the -->
117
+ <!-- "Software"), to deal in the Software without restriction, including -->
118
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
119
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
120
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
121
+ <!-- the following conditions: -->
122
+ <!-- -->
123
+ <!-- The above copyright notice and this permission notice shall be -->
124
+ <!-- included in all copies or substantial portions of the Software. -->
125
+ <!-- -->
126
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
127
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
128
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
129
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
130
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
131
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
132
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
133
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,161 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: exist-xquery-harness.xproc -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Date: 2011-08-30 -->
6
+ <!-- URI: http://xspec.googlecode.com/ -->
7
+ <!-- Tags: -->
8
+ <!-- Copyright (c) 2011 Florent Georges (see end of file.) -->
9
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
10
+ <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:exist="http://exist.sourceforge.net/NS/exist" xmlns:pkg="http://expath.org/ns/pkg" pkg:import-uri="http://www.jenitennison.com/xslt/xspec/exist/harness/xquery.xproc" name="exist-harness" type="t:exist-harness" version="1.0">
11
+ <p:documentation>
12
+ <p>This pipeline executes an XSpec test suite on an eXist instance.</p>
13
+ <p><b>Primary input:</b> A XSpec test suite document.</p>
14
+ <p><b>Primary output:</b> A formatted HTML XSpec report.</p>
15
+ <p>The XQuery library module to test must already be on the eXist instance.
16
+ The instance endpoint is passed in the option 'endpoint'. The runtime
17
+ utils library (also known as generate-query-utils.xql) must also be on
18
+ the instance (its location hint, that is the 'at' clause to use) is
19
+ passed in the option 'utils-lib'. The dir where you unzipped the XSpec
20
+ archive on your filesystem is passed in the option 'xspec-home'.</p>
21
+ </p:documentation>
22
+
23
+ <p:serialization port="result" indent="true" method="xhtml" encoding="UTF-8" include-content-type="true"/>
24
+
25
+ <p:option name="xspec-home" required="true"/>
26
+ <p:option name="query-at"/>
27
+ <p:option name="utils-lib" select="'xmldb:exist:///db/xspec/generate-query-utils.xql'"/>
28
+ <p:option name="endpoint" select="'http://localhost:8080/exist/rest/db/'"/>
29
+ <!-- if set, then save the generated query at this URI -->
30
+ <p:option name="compiled-uri"/>
31
+ <!-- if set, then save the generated query at this URI -->
32
+ <p:option name="report-uri"/>
33
+
34
+ <!-- TODO: Use the absolute URIs through the EXPath Packaging System. -->
35
+ <p:variable name="compiler" select="resolve-uri('src/compiler/generate-query-tests.xsl', $xspec-home)"/>
36
+ <p:variable name="formatter" select="resolve-uri('src/reporter/format-xspec-report.xsl', $xspec-home)"/>
37
+
38
+ <p:string-replace match="xsl:import/@href" name="compiler">
39
+ <p:with-option name="replace" select="concat('''', $compiler, '''')"/>
40
+ <p:input port="source">
41
+ <p:inline>
42
+ <xsl:stylesheet version="2.0">
43
+ <xsl:import href="..."/>
44
+ <xsl:template match="/">
45
+ <exist:text>
46
+ <xsl:call-template name="t:generate-tests"/>
47
+ </exist:text>
48
+ </xsl:template>
49
+ </xsl:stylesheet>
50
+ </p:inline>
51
+ </p:input>
52
+ </p:string-replace>
53
+
54
+ <p:choose>
55
+ <p:when test="p:value-available('query-at')">
56
+ <p:xslt name="compile">
57
+ <p:input port="source">
58
+ <p:pipe step="exist-harness" port="source"/>
59
+ </p:input>
60
+ <p:input port="stylesheet">
61
+ <p:pipe step="compiler" port="result"/>
62
+ </p:input>
63
+ <p:with-param name="query-at" select="$query-at"/>
64
+ <p:with-param name="utils-library-at" select="$utils-lib"/>
65
+ </p:xslt>
66
+ </p:when>
67
+ <p:otherwise>
68
+ <p:xslt name="compile">
69
+ <p:input port="source">
70
+ <p:pipe step="exist-harness" port="source"/>
71
+ </p:input>
72
+ <p:input port="stylesheet">
73
+ <p:pipe step="compiler" port="result"/>
74
+ </p:input>
75
+ <p:with-param name="utils-library-at" select="$utils-lib"/>
76
+ </p:xslt>
77
+ </p:otherwise>
78
+ </p:choose>
79
+
80
+ <p:escape-markup name="escape"/>
81
+
82
+ <p:choose>
83
+ <p:when test="p:value-available('compiled-uri')">
84
+ <p:store method="text">
85
+ <p:with-option name="href" select="$compiled-uri"/>
86
+ </p:store>
87
+ <p:identity>
88
+ <p:input port="source">
89
+ <p:pipe step="escape" port="result"/>
90
+ </p:input>
91
+ </p:identity>
92
+ </p:when>
93
+ <p:otherwise>
94
+ <p:identity/>
95
+ </p:otherwise>
96
+ </p:choose>
97
+
98
+ <p:wrap wrapper="exist:query" match="/*"/>
99
+ <p:wrap wrapper="c:body" match="/*"/>
100
+ <p:add-attribute attribute-name="content-type" attribute-value="application/xml" match="/*"/>
101
+ <p:wrap wrapper="c:request" match="/*"/>
102
+ <p:add-attribute attribute-name="method" attribute-value="POST" match="/*"/>
103
+ <p:add-attribute attribute-name="href" match="/*">
104
+ <p:with-option name="attribute-value" select="$endpoint"/>
105
+ </p:add-attribute>
106
+ <p:http-request name="run"/>
107
+ <p:choose>
108
+ <p:when test="exists(/exist:result/t:report)">
109
+ <p:load name="formatter">
110
+ <p:with-option name="href" select="$formatter"/>
111
+ </p:load>
112
+ <p:unwrap name="unwrap" match="/c:result">
113
+ <p:input port="source">
114
+ <p:pipe step="run" port="result"/>
115
+ </p:input>
116
+ </p:unwrap>
117
+ <p:xslt name="format-report">
118
+ <p:input port="source">
119
+ <p:pipe step="unwrap" port="result"/>
120
+ </p:input>
121
+ <p:input port="stylesheet">
122
+ <p:pipe step="formatter" port="result"/>
123
+ </p:input>
124
+ </p:xslt>
125
+ </p:when>
126
+ <p:otherwise>
127
+ <p:error code="t:ERR001">
128
+ <p:input port="source">
129
+ <p:pipe step="run" port="result"/>
130
+ </p:input>
131
+ </p:error>
132
+ </p:otherwise>
133
+ </p:choose>
134
+ </p:pipeline>
135
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
136
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
137
+ <!-- -->
138
+ <!-- Copyright (c) 2008, 2010 Jeni Tennison -->
139
+ <!-- -->
140
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
141
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
142
+ <!-- -->
143
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
144
+ <!-- a copy of this software and associated documentation files (the -->
145
+ <!-- "Software"), to deal in the Software without restriction, including -->
146
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
147
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
148
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
149
+ <!-- the following conditions: -->
150
+ <!-- -->
151
+ <!-- The above copyright notice and this permission notice shall be -->
152
+ <!-- included in all copies or substantial portions of the Software. -->
153
+ <!-- -->
154
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
155
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
156
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
157
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
158
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
159
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
160
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
161
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -0,0 +1,327 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ===================================================================== -->
3
+ <!-- File: harness-lib.xpl -->
4
+ <!-- Author: Florent Georges -->
5
+ <!-- Date: 2011-11-08 -->
6
+ <!-- URI: http://xspec.googlecode.com/ -->
7
+ <!-- Tags: -->
8
+ <!-- Copyright (c) 2011 Florent Georges (see end of file.) -->
9
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
10
+
11
+
12
+ <p:library xmlns:p="http://www.w3.org/ns/xproc"
13
+ xmlns:c="http://www.w3.org/ns/xproc-step"
14
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
15
+ xmlns:t="http://www.jenitennison.com/xslt/xspec"
16
+ xmlns:pkg="http://expath.org/ns/pkg"
17
+ pkg:import-uri="#none"
18
+ version="1.0">
19
+
20
+ <!--
21
+ Ensure there is exactly one document on the input port.
22
+
23
+ If this is the case, it behaves like p:identity, if not, it throws an error.
24
+
25
+ TODO: Does not work as is...
26
+ -->
27
+ <!--p:declare-step type="t:ensure-input">
28
+ <p:input port="source" primary="true"/>
29
+ <p:output port="result" primary="true"/>
30
+ <p:choose>
31
+ <p:xpath-context>
32
+ <p:pipe step="ensure-input" port="source"/>
33
+ </p:xpath-context>
34
+ <p:when test="empty(/)">
35
+ <p:error code="t:ERR002"/>
36
+ </p:when>
37
+ <p:otherwise>
38
+ <p:identity/>
39
+ </p:otherwise>
40
+ </p:choose>
41
+ </p:declare-step-->
42
+
43
+ <!--
44
+ Short-cut for p:parameters which passes through input, with primary parameters input.
45
+
46
+ Inspired from Geert Josten util library:
47
+ https://github.com/grtjn/xproc-ebook-conv/blob/master/src/nl/grtjn/xproc/util/utils.xpl
48
+ -->
49
+ <p:declare-step type="t:parameters" name="parameters">
50
+ <p:input port="source" primary="true"/>
51
+ <p:input port="in-parameters" primary="true" kind="parameter" sequence="true"/>
52
+ <p:output port="result" primary="true">
53
+ <p:pipe step="parameters" port="source"/>
54
+ </p:output>
55
+ <p:output port="parameters" primary="false">
56
+ <p:pipe step="params" port="result"/>
57
+ </p:output>
58
+ <p:parameters name="params">
59
+ <p:input port="parameters">
60
+ <p:pipe step="parameters" port="in-parameters"/>
61
+ </p:input>
62
+ </p:parameters>
63
+ </p:declare-step>
64
+
65
+ <!--
66
+ Pass through and possibly log the input.
67
+
68
+ If there is a parameter with the name $if-set, its value must be a URI, where
69
+ to log the input. If there is not, then no log is produced.
70
+ -->
71
+ <p:declare-step type="t:log" name="log">
72
+ <!-- the port declarations -->
73
+ <p:input port="source" primary="true"/>
74
+ <p:input port="parameters" primary="true" kind="parameter"/>
75
+ <p:output port="result" primary="true"/>
76
+ <p:option name="if-set" required="true"/>
77
+ <!-- retrieve the params -->
78
+ <t:parameters name="params"/>
79
+ <p:group>
80
+ <p:variable name="uri" select="/c:param-set/c:param[@name eq $if-set]/@value">
81
+ <p:pipe step="params" port="parameters"/>
82
+ </p:variable>
83
+ <p:choose>
84
+ <p:when test="$uri">
85
+ <p:store method="text">
86
+ <p:with-option name="href" select="$uri"/>
87
+ </p:store>
88
+ <p:identity>
89
+ <p:input port="source">
90
+ <p:pipe step="log" port="source"/>
91
+ </p:input>
92
+ </p:identity>
93
+ </p:when>
94
+ <p:otherwise>
95
+ <p:identity/>
96
+ </p:otherwise>
97
+ </p:choose>
98
+ </p:group>
99
+ </p:declare-step>
100
+
101
+ <!--
102
+ Compile the suite on source into a stylesheet on result.
103
+ -->
104
+ <p:declare-step type="t:compile-xslt" name="compile-xsl">
105
+ <!-- the port declarations -->
106
+ <p:input port="source" primary="true"/>
107
+ <p:input port="parameters" primary="true" kind="parameter"/>
108
+ <p:output port="result" primary="true"/>
109
+ <!-- retrieve the params -->
110
+ <t:parameters name="params"/>
111
+ <p:group>
112
+ <p:variable name="xspec-home" select="
113
+ /c:param-set/c:param[@name eq 'xspec-home']/@value">
114
+ <p:pipe step="params" port="parameters"/>
115
+ </p:variable>
116
+ <p:variable name="compiler-uri" select="
117
+ /c:param-set/c:param[@name eq 'compiler-uri']/@value">
118
+ <p:pipe step="params" port="parameters"/>
119
+ </p:variable>
120
+ <!-- if compiler-uri is not passed, then use xspec-home to resolve the compiler -->
121
+ <!-- if xspec-home is not passed, then use the packaging public URI -->
122
+ <p:variable name="compiler" select="
123
+ if ( $compiler-uri ) then
124
+ $compiler-uri
125
+ else if ( $xspec-home ) then
126
+ resolve-uri('src/compiler/generate-xspec-tests.xsl', $xspec-home)
127
+ else
128
+ 'http://www.jenitennison.com/xslt/xspec/generate-xspec-tests.xsl'"/>
129
+ <!-- load the compiler -->
130
+ <p:load name="compiler" pkg:kind="xslt">
131
+ <p:with-option name="href" select="$compiler"/>
132
+ </p:load>
133
+ <!-- actually compile the suite in a stylesheet -->
134
+ <p:xslt>
135
+ <p:input port="source">
136
+ <p:pipe port="source" step="compile-xsl"/>
137
+ </p:input>
138
+ <p:input port="stylesheet">
139
+ <p:pipe port="result" step="compiler"/>
140
+ </p:input>
141
+ <p:input port="parameters">
142
+ <p:empty/>
143
+ </p:input>
144
+ </p:xslt>
145
+ </p:group>
146
+ <!-- log the result? -->
147
+ <t:log if-set="log-compilation">
148
+ <p:input port="parameters">
149
+ <p:pipe step="params" port="parameters"/>
150
+ </p:input>
151
+ </t:log>
152
+ </p:declare-step>
153
+
154
+ <!--
155
+ Compile the suite on source into a query on result.
156
+
157
+ The query is wrapped into an element c:query. Parameters to the XSpec
158
+ XQuery compiler, AKA generate-query-tests.xsl, can be passed on the
159
+ parameters port (e.g. utils-library-at to set the at location hint to use
160
+ to import the XSpec utils library module in the generated query).
161
+ -->
162
+ <p:declare-step type="t:compile-xquery" name="compile-xq">
163
+ <!-- the port declarations -->
164
+ <p:input port="source" primary="true"/>
165
+ <p:input port="parameters" kind="parameter"/>
166
+ <p:output port="result" primary="true"/>
167
+ <!-- retrieve the params -->
168
+ <t:parameters name="params"/>
169
+ <p:group>
170
+ <!-- param: xspec-home: the dir with the sources of XSpec if EXPath packaging
171
+ is not supported -->
172
+ <p:variable name="xspec-home" select="
173
+ /c:param-set/c:param[@name eq 'xspec-home']/@value">
174
+ <p:pipe step="params" port="parameters"/>
175
+ </p:variable>
176
+ <!-- param: compiler-uri: the URI of the XSpec compiler to XQuery -->
177
+ <p:variable name="compiler-uri" select="
178
+ /c:param-set/c:param[@name eq 'compiler-uri']/@value">
179
+ <p:pipe step="params" port="parameters"/>
180
+ </p:variable>
181
+ <!-- if compiler-uri is not passed, then use xspec-home to resolve the compiler -->
182
+ <!-- if xspec-home is not passed, then use the packaging public URI -->
183
+ <p:variable name="compiler" select="
184
+ if ( $compiler-uri ) then
185
+ $compiler-uri
186
+ else if ( $xspec-home ) then
187
+ resolve-uri('src/compiler/generate-query-tests.xsl', $xspec-home)
188
+ else
189
+ 'http://www.jenitennison.com/xslt/xspec/generate-query-tests.xsl'"/>
190
+ <!-- wrap the generated query in a c:query element -->
191
+ <p:string-replace match="xsl:import/@href" name="compiler">
192
+ <p:with-option name="replace" select="concat('''', $compiler, '''')"/>
193
+ <p:input port="source">
194
+ <p:inline>
195
+ <!-- TODO: I think this is due to a bug in Calabash, if I don't create a node
196
+ using the prefix 't', then the biding is not visible to Saxon and it throws
197
+ a compilation error for this stylesheet... -->
198
+ <xsl:stylesheet version="2.0" t:dummy="...">
199
+ <xsl:import href="..."/>
200
+ <xsl:template match="/">
201
+ <c:query>
202
+ <xsl:call-template name="t:generate-tests"/>
203
+ </c:query>
204
+ </xsl:template>
205
+ </xsl:stylesheet>
206
+ </p:inline>
207
+ </p:input>
208
+ </p:string-replace>
209
+ <!-- actually compile the suite in a query -->
210
+ <p:xslt name="do-it">
211
+ <p:input port="source">
212
+ <p:pipe step="compile-xq" port="source"/>
213
+ </p:input>
214
+ <p:input port="stylesheet">
215
+ <p:pipe step="compiler" port="result"/>
216
+ </p:input>
217
+ </p:xslt>
218
+ </p:group>
219
+ <!-- log the result? -->
220
+ <t:log if-set="log-compilation">
221
+ <p:input port="parameters">
222
+ <p:pipe step="params" port="parameters"/>
223
+ </p:input>
224
+ </t:log>
225
+ </p:declare-step>
226
+
227
+ <!--
228
+ Get the XML report on source, and give the HTML report on result.
229
+
230
+ If xspec-home is set, it is used to resolve the XSLT that formats the
231
+ report. If not, its public URI is used, to be resolved through the
232
+ EXPath packaging system. If the document element is not an XSpec
233
+ t:report, the error t:ERR001 is thrown.
234
+ -->
235
+ <p:declare-step type="t:format-report" name="format">
236
+ <!-- the port declarations -->
237
+ <p:input port="source" primary="true"/>
238
+ <p:input port="parameters" kind="parameter"/>
239
+ <p:output port="result" primary="true"/>
240
+ <!-- retrieve the params -->
241
+ <t:parameters name="params"/>
242
+ <p:group>
243
+ <!-- param: xspec-home: the dir with the sources of XSpec if EXPath packaging
244
+ is not supported -->
245
+ <p:variable name="xspec-home" select="
246
+ /c:param-set/c:param[@name eq 'xspec-home']/@value">
247
+ <p:pipe step="params" port="parameters"/>
248
+ </p:variable>
249
+ <!-- either the public URI, or resolved from xspec-home if packaging not supported -->
250
+ <p:variable name="formatter" select="
251
+ if ( $xspec-home ) then
252
+ resolve-uri('src/reporter/format-xspec-report.xsl', $xspec-home)
253
+ else
254
+ 'http://www.jenitennison.com/xslt/xspec/format-xspec-report.xsl'"/>
255
+ <!-- log the report? -->
256
+ <t:log if-set="log-xml-report">
257
+ <p:input port="parameters">
258
+ <p:pipe step="format" port="parameters"/>
259
+ </p:input>
260
+ </t:log>
261
+ <!-- if there is a report, format it, or it is an error -->
262
+ <p:choose>
263
+ <p:when test="exists(/t:report)">
264
+ <p:load name="formatter" pkg:kind="xslt">
265
+ <p:with-option name="href" select="$formatter"/>
266
+ </p:load>
267
+ <p:xslt name="format-report">
268
+ <p:input port="source">
269
+ <p:pipe step="format" port="source"/>
270
+ </p:input>
271
+ <p:input port="stylesheet">
272
+ <p:pipe step="formatter" port="result"/>
273
+ </p:input>
274
+ <p:input port="parameters">
275
+ <p:empty/>
276
+ </p:input>
277
+ </p:xslt>
278
+ </p:when>
279
+ <p:otherwise>
280
+ <p:error code="t:ERR001">
281
+ <p:input port="source">
282
+ <p:inline>
283
+ <message>Not a t:report document</message>
284
+ </p:inline>
285
+ </p:input>
286
+ </p:error>
287
+ </p:otherwise>
288
+ </p:choose>
289
+ </p:group>
290
+ <!-- log the report? -->
291
+ <t:log if-set="log-report">
292
+ <p:input port="parameters">
293
+ <p:pipe step="format" port="parameters"/>
294
+ </p:input>
295
+ </t:log>
296
+ </p:declare-step>
297
+
298
+ </p:library>
299
+
300
+
301
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
302
+ <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
303
+ <!-- -->
304
+ <!-- Copyright (c) 2011 Florent Georges -->
305
+ <!-- -->
306
+ <!-- The contents of this file are subject to the MIT License (see the URI -->
307
+ <!-- http://www.opensource.org/licenses/mit-license.php for details). -->
308
+ <!-- -->
309
+ <!-- Permission is hereby granted, free of charge, to any person obtaining -->
310
+ <!-- a copy of this software and associated documentation files (the -->
311
+ <!-- "Software"), to deal in the Software without restriction, including -->
312
+ <!-- without limitation the rights to use, copy, modify, merge, publish, -->
313
+ <!-- distribute, sublicense, and/or sell copies of the Software, and to -->
314
+ <!-- permit persons to whom the Software is furnished to do so, subject to -->
315
+ <!-- the following conditions: -->
316
+ <!-- -->
317
+ <!-- The above copyright notice and this permission notice shall be -->
318
+ <!-- included in all copies or substantial portions of the Software. -->
319
+ <!-- -->
320
+ <!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
321
+ <!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
322
+ <!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
323
+ <!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
324
+ <!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
325
+ <!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
326
+ <!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
327
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->