dynarex-xslt 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/dynarex-xslt.rb +20 -7
- metadata +23 -21
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3bee1109722bf96ea0466674c34c111182857fb
|
4
|
+
data.tar.gz: e807efbef6b58cf1c7ea36de9ecc1b1dfa5a4909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386168b2a2065d8a52f872d18cc0d1f04f8e7979b625fbcf7fc344fc5018e1e172272874c81ed005d30e8d7e799b101abf3918cf89e9819fd1e11533d339807d
|
7
|
+
data.tar.gz: 564489a339a886f741d6e2c29c4c8c1b7876467f4123d7f4612a3f9d87279535bfef13f1c909bbd3fc240643ff9afe29c4995550503ff2582ac2692911a7f50f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex-xslt.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# file:
|
3
|
+
# file: dynarex-xslt.rb
|
4
4
|
|
5
5
|
require 'rexle-builder'
|
6
6
|
require 'rexle'
|
@@ -10,8 +10,10 @@ class DynarexXSLT
|
|
10
10
|
attr_accessor :schema, :xslt_schema
|
11
11
|
|
12
12
|
def initialize(options={})
|
13
|
+
|
13
14
|
o = {schema: '', xslt_schema: ''}.merge(options)
|
14
15
|
@schema, @xslt_schema = o.values
|
16
|
+
|
15
17
|
end
|
16
18
|
|
17
19
|
def to_xslt()
|
@@ -30,10 +32,13 @@ class DynarexXSLT
|
|
30
32
|
a = a_element.zip(a_html)
|
31
33
|
|
32
34
|
xml = RexleBuilder.new
|
33
|
-
raw_a = xml.xsl_stylesheet(xmlns_xsl:
|
34
|
-
|
35
|
+
raw_a = xml.xsl_stylesheet(xmlns_xsl: \
|
36
|
+
"http://www.w3.org/1999/XSL/Transform", version: "1.0") do
|
37
|
+
xml.xsl_output(method: "xml", indent: "yes", \
|
38
|
+
:"omit-xml-declaration" => "yes")
|
35
39
|
|
36
40
|
xml.xsl_template(match: a[0][0]) do
|
41
|
+
|
37
42
|
xml.send a[0][1][0].to_sym do
|
38
43
|
xml.xsl_apply_templates(select: 'summary')
|
39
44
|
xml.xsl_apply_templates(select: 'records/' + a[1][0])
|
@@ -41,15 +46,21 @@ class DynarexXSLT
|
|
41
46
|
end
|
42
47
|
|
43
48
|
xml.xsl_template(match: a[0][0] + '/summary') do
|
49
|
+
|
44
50
|
summary_fields = a[0][1][1] || []
|
51
|
+
|
45
52
|
summary_fields.each do |element, field|
|
46
|
-
|
53
|
+
|
54
|
+
elsym = (element.strip).to_sym
|
55
|
+
|
56
|
+
xml.send elsym do
|
47
57
|
xml.xsl_value_of(select: field)
|
48
58
|
end
|
49
59
|
end
|
50
60
|
end
|
51
61
|
|
52
62
|
xml.xsl_template(match: 'records/' + a[1][0]) do
|
63
|
+
|
53
64
|
xml.send a[1][1][0].to_sym do
|
54
65
|
a[1][1][1].each do |element, field|
|
55
66
|
xml.send element.to_sym do
|
@@ -60,12 +71,14 @@ class DynarexXSLT
|
|
60
71
|
end
|
61
72
|
|
62
73
|
end
|
63
|
-
|
64
|
-
Rexle.new(raw_a).xml(pretty: true).gsub('xsl_apply_templates',\
|
74
|
+
|
75
|
+
xml2 = Rexle.new(raw_a).xml(pretty: true).gsub('xsl_apply_templates',\
|
65
76
|
'xsl:apply-templates').gsub('xsl_value_of','xsl:value-of').\
|
66
77
|
gsub('xsl_template','xsl:template').gsub('xsl_','xsl:').\
|
67
78
|
gsub('xmlns_xsl','xmlns:xsl')
|
68
79
|
|
80
|
+
xml2
|
81
|
+
|
69
82
|
end
|
70
83
|
|
71
|
-
end
|
84
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex-xslt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,26 +10,28 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE1MDIxMjIwMDYyMloXDTE2MDIxMjIwMDYyMlowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
+
|
18
|
+
ggEBAK96qq2ei+B2DY042PrrPqvs0Fzw0l/OVP+x/H/nfH4VED6sYhn387bwLqje
|
19
|
+
3QYYQFpaanHwS3Zn3NkPM8jyTaaej+N81d2JNRTbngrMfJujJcUbCsEmBZHtVNDv
|
20
|
+
jaNA4I0zAXscLB+On8vzxrDdraQ46LjD87AfWWPsmxMlBUBfou0qarAVoBQ99wvH
|
21
|
+
53NNr+7XTeG5RSRj8NuDJ8z3KjcwUggEyHBs49xTzkCm2YzUGSqxL29ckdkCWJHb
|
22
|
+
DJJT7OL8AxuWrvf/s7s0oajlYT9DNu+aclBeK/hdXlT5QAmygBf7sGGGokBHO826
|
23
|
+
koG7LbnDO4D+3a5QCZX3iI3HuhkCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUtWErIsKMMbb+DVpFV6HhPLmMaNswJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAGJLqXgNp
|
27
|
+
WT8h4z9tFRJkHJKD7axY9Qyk3lB6vUcZenvng3gIf8XmxjqSaR4fDVlZkj1l6bbd
|
28
|
+
VHgD+V3ST4irbP7skIF4Ky5BOiK+k/MmbDEVIoRle2+JdzF4DIdVFuEugNRsWlVn
|
29
|
+
nCq5AcFCTG3Muur43RgVzw/umnMOO668R2VbTRQ/n9nQCI8jp1qGusf03veUR31W
|
30
|
+
sY61tDvPmbSupEaKv62SwLnrslwai0HamiKd/a3gQVSrIUw2tKQEq3t+bQKhYnnw
|
31
|
+
NXRRs3QgKmkyl++OcsaKGjM445fV/XAUzRPBb7EEEzNNLM1oZ9XFR6aWcX7yfYgu
|
32
|
+
u8esFUZzd1gL4Q==
|
31
33
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
34
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
33
35
|
dependencies: []
|
34
36
|
description:
|
35
37
|
email: james@r0bertson.co.uk
|
@@ -48,17 +50,17 @@ require_paths:
|
|
48
50
|
- lib
|
49
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
50
52
|
requirements:
|
51
|
-
- -
|
53
|
+
- - ">="
|
52
54
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
55
|
+
version: 2.1.2
|
54
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
57
|
requirements:
|
56
|
-
- -
|
58
|
+
- - ">="
|
57
59
|
- !ruby/object:Gem::Version
|
58
60
|
version: '0'
|
59
61
|
requirements: []
|
60
62
|
rubyforge_project:
|
61
|
-
rubygems_version: 2.
|
63
|
+
rubygems_version: 2.2.2
|
62
64
|
signing_key:
|
63
65
|
specification_version: 4
|
64
66
|
summary: dynarex-xslt
|
metadata.gz.sig
CHANGED
Binary file
|