rexslt 0.6.11 → 0.6.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +0 -0
- data/lib/rexslt.rb +21 -14
- metadata +27 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8677062cfbfef49a97de56c7fb501abf1f57c48bbea804ec13d4a6dcb93d69ed
|
4
|
+
data.tar.gz: dab58fa40b0365bef22573ec58c7b97cf86a5c4fdeddbd103395b2655a887e02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94cb4e9621cda90f7e4e785fd7b45d53b94734bc3e3f01b8713a45faad7f9fdaaf5cefb478917abad1ff4c3533e40bfc963061b2436c401de011d6a5676841f
|
7
|
+
data.tar.gz: 6fbef82369e5534e05928a13b7f3ff01562767d65bded4e32bc8fbba26754271e7d5f1abd1d32c7a79df252e70705d91760a3863f91bcf76a8acf9add5a8cdf4
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
-~V6x�+�:]cΈ�0㢩>�>�u����lժ�F5����W��8鹢�I��E�ϕ�k�2:e��P�ٺ���5����~�u�*�����M�L!]�������n���M
|
2
|
+
b\dy.{~�뾇�%���O�2|��-`jO��=�����ִT��g�G��(x3��D�n$��P86�1B�n�0��������q��Ռ)Y�u�W�k�fs8�Z�핲.�yw@��!Ұ�En�98�m�J5RR�|�C=�东i
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexslt.rb
CHANGED
@@ -8,7 +8,9 @@ require 'logger'
|
|
8
8
|
|
9
9
|
|
10
10
|
# modifications:
|
11
|
-
|
11
|
+
#
|
12
|
+
# 01-Feb-2019: bug fix: new line characters are no longer stripped
|
13
|
+
# between XSL elements
|
12
14
|
# 19-Jan-2018: feature: Implemented Rexslt#to_xml which returns pretty XML
|
13
15
|
# 16-Sep-2017: improvement: all predicates in an xsl:choose
|
14
16
|
# condition now must be true
|
@@ -59,32 +61,35 @@ end
|
|
59
61
|
|
60
62
|
class Rexslt
|
61
63
|
using RexPath
|
64
|
+
using ColouredText
|
62
65
|
|
63
|
-
def initialize(xsl, xml,
|
66
|
+
def initialize(xsl, xml, raw_params={}, debug: false)
|
64
67
|
|
65
68
|
## debugging variables
|
66
69
|
|
67
|
-
@log = Logger.new 'rxsl.log','daily'
|
68
70
|
@rn = 0
|
69
71
|
@rre = 0
|
70
72
|
|
71
73
|
super()
|
72
|
-
|
74
|
+
puts 'before options'.info if @debug
|
73
75
|
@options = {}
|
76
|
+
|
77
|
+
params = raw_params.merge({debug: false})
|
78
|
+
@debug = debug
|
74
79
|
custom_params = params.inject({}){|r,x| r.merge(Hash[x[0].to_s,x[1]])}
|
75
|
-
|
80
|
+
puts 'before xsl_transform'.info if @debug
|
76
81
|
|
77
82
|
xslt_transform(*[xsl, xml].map{|x| RXFHelper.read(x).first}, custom_params)
|
78
83
|
end
|
79
84
|
|
80
85
|
def to_s(options={})
|
81
|
-
@doc.to_s(@options.merge(options)).sub(/<
|
86
|
+
@doc.to_s(@options.merge(options)).sub(/<root4>/,'').sub(/<\/root4>$/m,'').lstrip
|
82
87
|
end
|
83
88
|
|
84
89
|
def to_doc(); @doc; end
|
85
90
|
|
86
91
|
def to_xml()
|
87
|
-
@doc.root.xml(pretty: true).sub(/<
|
92
|
+
@doc.root.xml(pretty: true).sub(/<root3>\n/,'').sub(/<\/root3>$/m,'')
|
88
93
|
end
|
89
94
|
|
90
95
|
private
|
@@ -377,6 +382,7 @@ class Rexslt
|
|
377
382
|
|
378
383
|
template_node.children.each_with_index do |x,j|
|
379
384
|
|
385
|
+
puts ('x: ' + x.inspect).debug if @debug
|
380
386
|
name = if x.kind_of? Rexle::Element then :read_raw_element
|
381
387
|
elsif x.is_a? String then :read_raw_text
|
382
388
|
elsif x.class.to_s =~ /Rexle::Comment$/ then :ignore
|
@@ -397,11 +403,10 @@ class Rexslt
|
|
397
403
|
if x.to_s.strip.length > 0 then
|
398
404
|
|
399
405
|
val = x.to_s.strip #
|
400
|
-
|
406
|
+
puts ('val: ' + val.inspect).debug if @debug
|
407
|
+
doc_element.add_element x.to_s
|
401
408
|
end
|
402
409
|
|
403
|
-
#doc_element.add_text x if x.is_a? String
|
404
|
-
|
405
410
|
end
|
406
411
|
|
407
412
|
# element: xml element
|
@@ -521,16 +526,16 @@ class Rexslt
|
|
521
526
|
|
522
527
|
def xslt_transform(raw_xsl, xml, custom_params={})
|
523
528
|
|
524
|
-
|
529
|
+
puts 'inside xslt_transform'.info if @debug
|
525
530
|
|
526
531
|
doc_xml = xml.is_a?(Rexle) ? xml : Rexle.new(xml)
|
527
532
|
|
528
533
|
@doc_xsl = raw_xsl.is_a?(Rexle) ? raw_xsl : Rexle.new(raw_xsl)
|
529
|
-
|
534
|
+
puts 'after @doc_xsl'.info if @debug
|
530
535
|
|
531
536
|
#jr2040516 filter_out_spaces @doc_xsl.root
|
532
537
|
|
533
|
-
@doc = Rexle.new '<
|
538
|
+
@doc = Rexle.new '<root4></root4>', debug: @debug
|
534
539
|
|
535
540
|
indent = 0
|
536
541
|
|
@@ -552,7 +557,7 @@ class Rexslt
|
|
552
557
|
end
|
553
558
|
|
554
559
|
h = @doc_xsl.root.element("xsl:output/attribute::*")
|
555
|
-
|
560
|
+
puts 'after h'.info if @debug
|
556
561
|
|
557
562
|
if h and ((h[:method] and h[:method].downcase == 'html') \
|
558
563
|
or h[:'omit-xml-declaration'] == 'yes') then
|
@@ -576,6 +581,8 @@ class Rexslt
|
|
576
581
|
# using the 1st template
|
577
582
|
xpath = String.new @templates.to_a[0][0]
|
578
583
|
out = read_node(@templates.to_a[0][-1], doc_xml.element(xpath), @doc.root, indent)
|
584
|
+
|
585
|
+
puts ('out: ' + out.inspect).debug if @debug
|
579
586
|
|
580
587
|
html = @doc.root.element('html')
|
581
588
|
|
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.6.
|
4
|
+
version: 0.6.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMjAxMTk1MjQyWhcN
|
15
|
+
MjAwMjAxMTk1MjQyWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCr1Aj5
|
17
|
+
q9c4JQkcjTisuXqjdp5xqnBYNA5ZSWRD7mjzwdKajCSFEE/Qbe5W51pdJLf7T4F+
|
18
|
+
nOSQVOQ7bbtUFlmaAVXmzYXM84+kp7yZJVrTPyIFgsO+2trIizZ0HsE4H2CPBhrX
|
19
|
+
oefgXQCumOBjwBswUzD9qqvNAX0l0LVa3QBidwA4IHcc8RIFnu/1JOk11GCHYYNR
|
20
|
+
T31kN5iGvSH1Cl4cXYuD5PX44bTJ+zdBWusZcCV71MM/QLEglSL9HiS/PNjExMTk
|
21
|
+
8Uu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
|
36
|
+
hyIDI2yf0ueF+Lirvch+gr7J
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: rxfhelper
|
@@ -99,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
103
|
- !ruby/object:Gem::Version
|
100
104
|
version: '0'
|
101
105
|
requirements: []
|
102
|
-
|
103
|
-
rubygems_version: 2.6.13
|
106
|
+
rubygems_version: 3.0.2
|
104
107
|
signing_key:
|
105
108
|
specification_version: 4
|
106
109
|
summary: Rexslt is an XSLT processor written purely in Ruby
|
metadata.gz.sig
CHANGED
Binary file
|