schematronium 0.0.0-java → 0.1.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/schematronium.rb +8 -6
- data/schematronium.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e01f9933d9bb8a0c0243986a3d689faead19cfe
|
4
|
+
data.tar.gz: a95659f5b6b800072daab4a3e6bbda2b564930ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432fa66139ee4a2dbc825b77a8c2438c567e05241e5ff839771898eb7d740849411d2993422c444ca054b5b71c158be5b313fba8268d85cac86b11a21e6ab70c
|
7
|
+
data.tar.gz: 62dac2298331473194d1646401f6ffd27ff10e3ec317b4088cbb3c15aee401d2a269ad4d56791c1a736914a2f91d8cbb498053e2fb8dbcfe62692eeb7559143e
|
data/lib/schematronium.rb
CHANGED
@@ -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
|
-
|
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 =
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
data/schematronium.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'schematronium'
|
3
|
-
gem.version = '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'
|