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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b73e6c96adfee33703b4e68bbeee6a1759a1813a
4
- data.tar.gz: 31ec1a11f113286c77e0fe14015020d39726ea07
3
+ metadata.gz: e3bee1109722bf96ea0466674c34c111182857fb
4
+ data.tar.gz: e807efbef6b58cf1c7ea36de9ecc1b1dfa5a4909
5
5
  SHA512:
6
- metadata.gz: 40c3a19cd2e419acdf46d2e3611b18624b005818826df026616de0927d554a80d9336355c6884059650c0ce0f7dc20568e0516dd5d99e4496454bf05c2bccf1d
7
- data.tar.gz: a47ed64c4e41dabef212c6924e1462aa8cab8195cad4129fd43d02349049dc71138a43dc6afcf59ce51d99c09ac3eca1e8e3a49f081a97ee439970feb4346190
6
+ metadata.gz: 386168b2a2065d8a52f872d18cc0d1f04f8e7979b625fbcf7fc344fc5018e1e172272874c81ed005d30e8d7e799b101abf3918cf89e9819fd1e11533d339807d
7
+ data.tar.gz: 564489a339a886f741d6e2c29c4c8c1b7876467f4123d7f4612a3f9d87279535bfef13f1c909bbd3fc240643ff9afe29c4995550503ff2582ac2692911a7f50f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # file: recordx-xslt.rb
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: "http://www.w3.org/1999/XSL/Transform", version: "1.0") do
34
- xml.xsl_output(method: "xml", indent: "yes")
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
- xml.send (element.strip).to_sym do
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.5
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
- MIIDRDCCAiygAwIBAgIBADANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
14
  YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTEzMDIwNjIwNTcyMloXDTE0MDIwNjIwNTcyMlowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE1MDIxMjIwMDYyMloXDTE2MDIxMjIwMDYyMlowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBANuE2Pi28LeiQvNdbp+JfyOQDmDX3GpSnRwr2fymNZWCcxqbXZT0Ptrq/fpn
19
- W0T/F41QW779FZhi4sn6mk06iHgYpZqLrmOCudoak1TDlBW99YJnqDFF25wrW9O1
20
- 7Mp4nhk29cAf3/L2hDTKSBLMzpUziX60PXNL1MYes3JmRcNr0//sC6kHjfyYOQn0
21
- dh/kCHzX8FUPh+m7zqJS7xQKxWDUBwIvtMoi4z8rklII2TkMN9I0pv8RzJmj44bk
22
- 6BFsqY8aCQEUSTrCZZK2fo1oxTvn7NSLpP+sKCjsCZPUXZdsmEse8p4eqKSaxxNa
23
- BGPXN/SfHhaOOp+EhWaXWLY4Bv0CAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4E
24
- FgQUjMIC8/Z09FU7KQnTvmisnQ9QEDUwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEB
25
- BQUAA4IBAQDPvfBiEF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7skIF4Ky5BOiK+k/MmbDEVIoRle2+JdzF4DIdVFuEugNRsWlVn
29
+ nCq5AcFCTG3Muur43RgVzw/umnMOO668R2VbTRQ/n9nQCI8jp1qGusf03veUR31W
30
+ sY61tDvPmbSupEaKv62SwLnrslwai0HamiKd/a3gQVSrIUw2tKQEq3t+bQKhYnnw
31
+ NXRRs3QgKmkyl++OcsaKGjM445fV/XAUzRPBb7EEEzNNLM1oZ9XFR6aWcX7yfYgu
32
+ u8esFUZzd1gL4Q==
31
33
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
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: '0'
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.0.0.rc.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