schematronium 0.0.0-java → 0.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 520909cf6a2ba7b59423fc3894583ec0da94640e
4
- data.tar.gz: 2779f180b43c93fd220b9ef5f55a45da9bd2235c
3
+ metadata.gz: 1e01f9933d9bb8a0c0243986a3d689faead19cfe
4
+ data.tar.gz: a95659f5b6b800072daab4a3e6bbda2b564930ef
5
5
  SHA512:
6
- metadata.gz: cb4d0dfb69c613e2b39304bcdbc839b8c4be8ad0f29de60f6d4c43815ea2f040a9ebfe2751f12de1c1adedbbea573e3fee8c1bb2ab6ace5fcd0adbde27750583
7
- data.tar.gz: ba936fda68f7ac25513012ad22a11420dc3a9ccb99d7bde0491cb62bfd80ca472993072f249ed44e299147e019f3010942bdb136bb19c0adbbde036ebef5e0c9
6
+ metadata.gz: 432fa66139ee4a2dbc825b77a8c2438c567e05241e5ff839771898eb7d740849411d2993422c444ca054b5b71c158be5b313fba8268d85cac86b11a21e6ab70c
7
+ data.tar.gz: 62dac2298331473194d1646401f6ffd27ff10e3ec317b4088cbb3c15aee401d2a269ad4d56791c1a736914a2f91d8cbb498053e2fb8dbcfe62692eeb7559143e
@@ -7,7 +7,9 @@ class Schematronium
7
7
  #
8
8
  # @param [String, IO, File] schematron A schematron document, as either an IO object responding to #read,
9
9
  # a filename, or a [String]
10
- def initialize(schematron)
10
+ # @param [String] phase The name of the schematron phase to run. By default, the
11
+ # special "run everything" phase is run
12
+ def initialize(schematron, phase="'#ALL'")
11
13
  stages = %w|iso_dsdl_include.xsl
12
14
  iso_abstract_expand.xsl
13
15
  iso_svrl_for_xslt2.xsl|.map{|s| iso_file s}
@@ -26,11 +28,11 @@ class Schematronium
26
28
  # Run schematron through each stage of the iso_schematron pipeline
27
29
  # then stringify the final result because Saxon.XSLT can't take
28
30
  # an XML doc as input
29
- @sch_script = Saxon.XSLT(
30
- stages.reduce(schematron) do |result, stage|
31
- stage.transform(result)
32
- end.to_s
33
- )
31
+ @sch_script = stages[0].transform(schematron)
32
+ @sch_script = stages[1].transform(@sch_script)
33
+ @sch_script = stages[2].transform(@sch_script, 'phase' => phase)
34
+
35
+ @sch_script = Saxon::XSLT(@sch_script.to_s)
34
36
  end
35
37
 
36
38
  # Run schematron over xml document, returning the resulting XML
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'schematronium'
3
- gem.version = '0.0.0'
3
+ gem.version = '0.1.0'
4
4
  gem.date = '2015-07-27'
5
5
  gem.summary = 'Tool for running schematron against XML strings/files'
6
6
  gem.description = 'Wraps the saxon-xslt wrapper for Saxon 9 HE, providing a simple (one function) interface for running a schematron against an XML string or file'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schematronium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - Dave Mayo