rexslt 0.6.3 → 0.6.4

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: d6b973b4823311eacb05ede80db2f1399a380714
4
- data.tar.gz: 348390c05cdcbe54a19bd9b330bbd0f3cea5748b
3
+ metadata.gz: eaf222d869dfbe17e3186ded72bc4bcc0a0fad29
4
+ data.tar.gz: 81991c23f1a45ab622dbdd4d700983ec2d0ce702
5
5
  SHA512:
6
- metadata.gz: 2cc571cf1a357a76c1e8a4a5a94dd78b61235a07b625d2bb21b1e778c7697a2a1806d58d333b0c60d5292056fb291ca3a4e5b03fa9318141bba4cdab9a258ca9
7
- data.tar.gz: 793b84303be053d9888b909169caa82f6b1fe5839dcc047aae92e175ec4e6768da67e15e3335941e8f54daa3fb100aa6cc18ab68a435ed673991448e358174bf
6
+ metadata.gz: 694802525335760a469684f4c61d3601404832559ac1cd3a4fb93443e0ba112c81eafc8661e1358c101d67230c0c41b53d19a49f8ad7b9a93a39575121466a56
7
+ data.tar.gz: eaf9ca255cdbad0d7b54f5a4163eb6c6f56b721743f6e1593af67e79ef1eb2411ce72eafb9ad9365a900f67376ca152cabad1074c56adcbb27a510dd53b657af
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- nڱ�LHB�inp��e�
2
- �h��eZ3�����ߤ^�����Cqa
1
+ H#�H�׼?��T˫m�0?�):�KDF��(���?���/cf�;�g�An;�
2
+ !��(�ܔ��T�.��\A��l_5����[����GU_����#rF?����a���U�Y0p�?���j��?�F���tO�,í� d�����}�$�-`ܮ��U[G���8�� *�F�����P��l���E����~"�c?��~� �+.�9�:=k1x�Q�ث��9����L; �բ{�O6n�!~;��
data/lib/rexslt.rb CHANGED
@@ -7,7 +7,8 @@ require 'rxfhelper'
7
7
 
8
8
 
9
9
  # modifications:
10
-
10
+ # 30-Apr-2016: bug fix: This class can now be executed within an
11
+ # eval statement which runs within another class
11
12
  # 24-Apr-2016: The position() function is now supported within an
12
13
  # xsl:value-of select attribute
13
14
  # An xsl:attribute value can now be rendered using
@@ -54,7 +55,6 @@ class Rexslt
54
55
  super()
55
56
  @options = {}
56
57
  custom_params = params.inject({}){|r,x| r.merge(Hash[x[0].to_s,x[1]])}
57
-
58
58
  xslt_transform(*[xsl, xml].map{|x| RXFHelper.read(x).first}, custom_params)
59
59
  end
60
60
 
@@ -224,7 +224,7 @@ class Rexslt
224
224
  end
225
225
 
226
226
  def xsl_element(element, x, doc_element, indent, i)
227
-
227
+
228
228
  indent_before(element, x, doc_element, indent + 1, i) if @indent == true
229
229
 
230
230
  name = x.attributes[:name]
@@ -235,7 +235,6 @@ class Rexslt
235
235
  end
236
236
 
237
237
  new_element = Rexle::Element.new(name) # .add_text(x.value.strip)
238
- #jr060416 doc_element.text = element.text if element.text
239
238
  new_element.text = element.text if element.text
240
239
 
241
240
  read_node(x, element, new_element, indent, i)
@@ -345,17 +344,17 @@ class Rexslt
345
344
  # doc_element: target document element
346
345
  #
347
346
  def read_node(template_node, element, doc_element, indent, i=0)
348
-
349
- procs = {
350
- "Rexle::Element" => :read_raw_element,
351
- "String" => :read_raw_text,
352
- "Rexle::Comment" => :ignore
353
- }
354
347
 
355
348
  template_node.children.each_with_index do |x,j|
356
-
357
- # x: an XSL element, or a string or a comment
358
- method(procs[x.class.to_s]).call(element, x, doc_element, indent, i)
349
+
350
+ name = if x.kind_of? Rexle::Element then :read_raw_element
351
+ elsif x.is_a? String then :read_raw_text
352
+ elsif x.class.to_s =~ /Rexle::Comment$/ then :ignore
353
+ else
354
+ :ignore
355
+ end
356
+
357
+ method(name).call(element, x, doc_element, indent, i)
359
358
  end
360
359
 
361
360
  end
@@ -535,7 +534,7 @@ class Rexslt
535
534
 
536
535
  # fetch the templates
537
536
  #puts "Rexle:Version: " + Rexle.version
538
-
537
+
539
538
  @templates = @doc_xsl.root.xpath('xsl:template').inject({}) do |r,x|
540
539
  r.merge(x.attributes[:match] || x.attributes[:select] => x)
541
540
  end
@@ -543,7 +542,6 @@ class Rexslt
543
542
  # using the 1st template
544
543
  xpath = String.new @templates.to_a[0][0]
545
544
  out = read_node(@templates.to_a[0][-1], doc_xml.element(xpath), @doc.root, indent)
546
-
547
545
 
548
546
  if @doc_xsl.root.element('xsl:output[@method="html"]') then
549
547
 
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.3
4
+ version: 0.6.4
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-04-24 00:00:00.000000000 Z
34
+ date: 2016-04-30 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rxfhelper
@@ -39,20 +39,20 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.2'
42
+ version: '0.3'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.2.3
45
+ version: 0.3.0
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.2'
52
+ version: '0.3'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.2.3
55
+ version: 0.3.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rexle
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: '1.3'
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 1.3.29
65
+ version: 1.3.30
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
@@ -72,7 +72,7 @@ dependencies:
72
72
  version: '1.3'
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.3.29
75
+ version: 1.3.30
76
76
  description:
77
77
  email: james@r0bertson.co.uk
78
78
  executables: []
metadata.gz.sig CHANGED
Binary file