rexslt 0.4.4 → 0.5.0
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rexslt.rb +26 -22
- metadata +10 -10
- 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: 1e5cb3fb23bdbadadbc09927caf8290a487024ba
|
|
4
|
+
data.tar.gz: c106d6397abf4421c4585edeb08731672024bc22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2413e53b29a3dad2412d64fb7fb2a83780b9ae462a29ead1802fec907580d7db83618e03d99ff361192d4de28f35e7799207196945352aa28a0790afe8e725aa
|
|
7
|
+
data.tar.gz: 61c384317e59acdcedabd667fd806cd380b229b5b73b85468b8abfc90550fe0236241da8a6c8881cb3ad1875a403a77f6f072a862b6f2547ba456b91cc15c729
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/rexslt.rb
CHANGED
|
@@ -6,32 +6,37 @@ require 'rexle'
|
|
|
6
6
|
require 'rxfhelper'
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
module RexPath
|
|
10
|
+
|
|
11
|
+
refine Rexle::Element do
|
|
12
|
+
|
|
13
|
+
def to_xpath(option=nil)
|
|
14
|
+
def attribute_scan(node)
|
|
15
|
+
result = ''
|
|
16
|
+
attr = %w(id class).detect {|x| node.attributes.has_key? x}
|
|
17
|
+
if attr then
|
|
18
|
+
value = node.attribute[attr]
|
|
19
|
+
result = "[@%s='%s']" % [attr, value]
|
|
20
|
+
end
|
|
21
|
+
result
|
|
17
22
|
end
|
|
18
|
-
result
|
|
19
|
-
end
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
def doc_scan(node, option=nil)
|
|
25
|
+
name = node.name
|
|
26
|
+
attribute = option == :no_cond ? '' : attribute_scan(node)
|
|
27
|
+
result = doc_scan(node.parent,option) unless node.root === node.doc_root
|
|
28
|
+
[result, name.to_s + attribute]
|
|
29
|
+
end
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
doc_scan(self, option).flatten.compact.join('/')
|
|
32
|
+
end
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
class Rexslt
|
|
34
|
-
|
|
38
|
+
using RexPath
|
|
39
|
+
|
|
35
40
|
def initialize(xsl, xml, params={})
|
|
36
41
|
super()
|
|
37
42
|
custom_params = params.inject({}){|r,x| r.merge(Hash[x[0].to_s,x[1]])}
|
|
@@ -324,7 +329,6 @@ class Rexslt
|
|
|
324
329
|
end
|
|
325
330
|
|
|
326
331
|
#doc_element.add_text x if x.is_a? String
|
|
327
|
-
#puts '300 doc_element: ' + doc_element.inspect
|
|
328
332
|
|
|
329
333
|
end
|
|
330
334
|
|
|
@@ -422,9 +426,9 @@ class Rexslt
|
|
|
422
426
|
|
|
423
427
|
def xslt_transform(raw_xsl, xml, custom_params={})
|
|
424
428
|
|
|
425
|
-
doc_xml = Rexle.new
|
|
426
|
-
|
|
427
|
-
@doc_xsl = Rexle.new
|
|
429
|
+
doc_xml = xml.is_a?(Rexle) ? xml : Rexle.new(xml)
|
|
430
|
+
|
|
431
|
+
@doc_xsl = raw_xsl.is_a?(Rexle) ? raw_xsl : Rexle.new(raw_xsl)
|
|
428
432
|
|
|
429
433
|
filter_out_spaces @doc_xsl.root
|
|
430
434
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rexslt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
38j2+6ULVWalsVein3whb7qB6IOvxoSqjz6n7jAKFGHovoXPUqpv5y5Yor23rTrn
|
|
32
32
|
0YwisIc3UkL30g==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2016-03-
|
|
34
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rxfhelper
|
|
@@ -39,40 +39,40 @@ dependencies:
|
|
|
39
39
|
requirements:
|
|
40
40
|
- - "~>"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '0.
|
|
42
|
+
version: '0.2'
|
|
43
43
|
- - ">="
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: 0.
|
|
45
|
+
version: 0.2.3
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
|
49
49
|
requirements:
|
|
50
50
|
- - "~>"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '0.
|
|
52
|
+
version: '0.2'
|
|
53
53
|
- - ">="
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 0.
|
|
55
|
+
version: 0.2.3
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
57
|
name: rexle
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
60
|
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '1.
|
|
62
|
+
version: '1.3'
|
|
63
63
|
- - ">="
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 1.
|
|
65
|
+
version: 1.3.11
|
|
66
66
|
type: :runtime
|
|
67
67
|
prerelease: false
|
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
|
69
69
|
requirements:
|
|
70
70
|
- - "~>"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '1.
|
|
72
|
+
version: '1.3'
|
|
73
73
|
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 1.
|
|
75
|
+
version: 1.3.11
|
|
76
76
|
description:
|
|
77
77
|
email: james@r0bertson.co.uk
|
|
78
78
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|