rexslt 0.6.5 → 0.6.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a50a74890cca7d7df1bee74c7c964bd5ae494c7
4
- data.tar.gz: da1d29bb6c43e63bcc255cedc0f90e46cbf4687c
3
+ metadata.gz: 4dbbe98957afc6c78b725745365f82a3660f6706
4
+ data.tar.gz: a77613d38f753e5f78d6e4c1051c5f61f4bc66f8
5
5
  SHA512:
6
- metadata.gz: b15e5f6253c8855a070a1d74f625b4d0ec9555862d401b6ba965c26f18b32a4a4ce157aa7357252706ac16660286a3e1ef1a5e1547d2ead65dd638e84a821a85
7
- data.tar.gz: e75ae71a56b7273a78e02e486782a07a0b2612fa7633b6828e1aabbbaf5a1ad2c08feba427940b899e2150c86bc30e355cd96aaba2c68ece795c57b303ba7abd
6
+ metadata.gz: 5e38b0b15a2c5a3946c4062169c6d59cc374a27e0f59faf4927f43f01ecdabc767858395347af30b760537c44ed0871a8e0c575ec117e0eba0e6f6cfea0744da
7
+ data.tar.gz: d8c0cfa937bf54c2d92f106b7156ea9b1f12d12cbed65f445ca371f56d4371b9eb40c8c7659336a747e276d4fbf381be5875b7d6de4891853897ee6b9c365e33
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexslt.rb CHANGED
@@ -8,6 +8,10 @@ require 'rxfhelper'
8
8
 
9
9
  # modifications:
10
10
 
11
+ # 04-May-2016: bug fix: disabled the method which strips out all new
12
+ # line spaces, and replaced it with a statement in the
13
+ # read_raw_text() method which strips out space before and
14
+ # after the text
11
15
  # 03-May-2016: A returned HTML document will no longer include an
12
16
  # XML declaration by default
13
17
  # 30-Apr-2016: bug fix: This class can now be executed within an
@@ -227,7 +231,7 @@ class Rexslt
227
231
  end
228
232
 
229
233
  def xsl_element(element, x, doc_element, indent, i)
230
-
234
+
231
235
  indent_before(element, x, doc_element, indent + 1, i) if @indent == true
232
236
 
233
237
  name = x.attributes[:name]
@@ -369,7 +373,7 @@ class Rexslt
369
373
  #val = @indent == true ? padding(doc_element, raw_indent, x) : ''
370
374
  if x.to_s.strip.length > 0 then
371
375
 
372
- val = x.to_s #
376
+ val = x.to_s.strip #
373
377
  doc_element.add_element val
374
378
  end
375
379
 
@@ -401,8 +405,8 @@ class Rexslt
401
405
 
402
406
  new_element = x.clone
403
407
 
404
- new_element.attributes.each do |k,raw_v|
405
-
408
+ new_element.attributes.each do |k,raw_v|
409
+
406
410
  v = raw_v.is_a?(Array) ? raw_v.join(' ') : raw_v
407
411
 
408
412
  if v[/{/] then
@@ -499,7 +503,7 @@ class Rexslt
499
503
  @doc_xsl = raw_xsl.is_a?(Rexle) ? raw_xsl : Rexle.new(raw_xsl)
500
504
 
501
505
 
502
- filter_out_spaces @doc_xsl.root
506
+ #jr2040516 filter_out_spaces @doc_xsl.root
503
507
 
504
508
  @doc = Rexle.new '<root></root>'
505
509
  indent = 0
@@ -545,8 +549,19 @@ class Rexslt
545
549
  # using the 1st template
546
550
  xpath = String.new @templates.to_a[0][0]
547
551
  out = read_node(@templates.to_a[0][-1], doc_xml.element(xpath), @doc.root, indent)
552
+
553
+ html = @doc.root.element('html')
554
+
555
+ if html then
556
+
557
+ if h and h[:'omit-xml-declaration'] != 'yes' then
558
+ else
559
+ @options[:declaration] = :none
560
+ end
561
+
562
+ end
548
563
 
549
- if @doc_xsl.root.element('xsl:output[@method="html"]') then
564
+ if @doc_xsl.root.element('xsl:output[@method="html"]') or html then
550
565
 
551
566
  head = @doc.root.element('html/head')
552
567
 
@@ -569,14 +584,7 @@ class Rexslt
569
584
  end
570
585
 
571
586
 
572
- if @doc.root.element('html') then
573
-
574
- if h and h[:'omit-xml-declaration'] != 'yes' then
575
- else
576
- @options[:declaration] = :none
577
- end
578
-
579
- end
587
+
580
588
 
581
589
  out
582
590
 
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.5
4
+ version: 0.6.6
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-05-03 00:00:00.000000000 Z
34
+ date: 2016-05-04 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rxfhelper
metadata.gz.sig CHANGED
Binary file