rexslt 0.6.1 → 0.6.2

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: 9448fe886690e81555907e4b213e39db47d450c0
4
- data.tar.gz: 8a45f7ce5b6546392aeacb5a09d2390ede1481b4
3
+ metadata.gz: 9b8dd32d843b131cc31484f5e948bc279539912f
4
+ data.tar.gz: 83d808af7960652ef1e94907eb950f95522cd3ab
5
5
  SHA512:
6
- metadata.gz: 8f99899f6a01154decb23672d303d30752aa663e6f7193fcc32a3896e64dc1c8801f264879a03291a4366f20f8d828d643ec239d6b1d650d2406242ac40fd44a
7
- data.tar.gz: 8cded864fb2bf25b30e4dd1171e8616185278fce303abc8a0c94ce57dac8a4aeccb8193c29cdb132bd22a87bcb238a2be4ead2b22e9c3dc331c919c9fe8f4e8b
6
+ metadata.gz: 80734e550e8a66f18fa6f4867044e1998f3eed693c458827e6ea6f952af591aed20a407950b67d6496f3074e0045bf4010ca47113621689e9c3e80e91f748954
7
+ data.tar.gz: a26995174afc0b233201ff2dc9dc3058a39d88d3b9fc16e797182b5a596b93889a79f030a779fee071e7f0f461772338f2e4477e5b81cefbe4df96999655c1e2
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexslt.rb CHANGED
@@ -6,6 +6,11 @@ require 'rexle'
6
6
  require 'rxfhelper'
7
7
 
8
8
 
9
+ # modifications:
10
+
11
+ # 24-Apr-2016: An xsl:attribute value can now be rendered using
12
+ # an xsl:text element
13
+
9
14
  module RexPath
10
15
 
11
16
  refine Rexle::Element do
@@ -172,6 +177,12 @@ class Rexslt
172
177
 
173
178
  e = x.element('xsl:value-of')
174
179
  value = value_of(e, element) if e
180
+
181
+ av = x.element('xsl:text')
182
+ if av then
183
+ value = av.text
184
+ end
185
+
175
186
  doc_element.add_attribute(name, value)
176
187
  end
177
188
 
@@ -182,7 +193,7 @@ class Rexslt
182
193
  condition = xsl_node.attributes[:test]
183
194
  node = element.element condition
184
195
 
185
- if node and node == true
196
+ if node
186
197
  read_node(xsl_node, element, doc_element, indent, i)
187
198
  true
188
199
  else
@@ -265,39 +276,20 @@ class Rexslt
265
276
  nodes.reverse! if order.downcase == 'descending'
266
277
  end
267
278
 
268
- nodes.each {|node| read_node(x, node, doc_element, indent, i)}
279
+ nodes.each.with_index {|node, j| read_node(x, node, doc_element, indent, j+1)}
269
280
 
270
281
  end
271
282
 
272
283
  def xsl_if(element, x, doc_element, indent, i=0)
273
284
 
274
- condition = x.attributes[:test].clone
275
-
276
- cond = condition.slice!(/position\(\) < \d+/)
277
-
278
- result = if cond then
279
-
280
- cond.sub!(/position\(\)/, i.to_s)
281
- cond.sub!(/&lt;/,'<')
282
- cond.sub!(/&gt;/,'>')
283
-
284
- b = eval(cond)
285
-
286
- if b then
287
-
288
- if condition.length > 0 then
289
- element.element condition
290
- else
291
- true
292
- end
293
- else
294
- false
295
- end
296
-
297
- else
285
+ cond = x.attributes[:test].clone
286
+
287
+ cond.sub!(/position\(\)/, i.to_s)
288
+ cond.sub!(/&lt;/,'<')
289
+ cond.sub!(/&gt;/,'>')
290
+ cond.sub!(/\bmod\b/,'%')
298
291
 
299
- element.element condition
300
- end
292
+ result = element.element cond
301
293
 
302
294
  if result then
303
295
  read_node x, element, doc_element, indent, i
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.1
4
+ version: 0.6.2
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-15 00:00:00.000000000 Z
34
+ date: 2016-04-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rxfhelper
metadata.gz.sig CHANGED
Binary file