xml-smart 0.3.14 → 0.3.15
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
- data/lib/xml/smart.rb +7 -3
- data/xml-smart.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f5bdaa76b04eb422f59648a1387a106751fbd78
|
|
4
|
+
data.tar.gz: c782e442fc1e57a81a6e516bf5d73ba29652c24f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76bdff5b7e342a74293bbd7c799907cd027abaf222b06e2eb70f800457ae6d956401655218bec49f680adf9c5e29014c8113a12bea3cae7f7767628aeb83b23f
|
|
7
|
+
data.tar.gz: f9f5c313c4d6afdae809cae090ac81ac392ad5f0397569024f9c543e2c6f097aeb5d570a7ee51c40030a0c34574cd9d35329032b5ee72af543224213a9410776
|
data/lib/xml/smart.rb
CHANGED
|
@@ -97,7 +97,7 @@ module Nokogiri
|
|
|
97
97
|
path = ((relative_to || self.document.basepath.to_s) + '/').sub(/\/+$/,'/')
|
|
98
98
|
ctx = XPathContext.new(self)
|
|
99
99
|
ctx.register_namespaces "xi"=>"http://www.w3.org/2001/XInclude"
|
|
100
|
-
ctx.evaluate('
|
|
100
|
+
ctx.evaluate('.//xi:include').each do |ele|
|
|
101
101
|
name = ele.attributes['href'].value
|
|
102
102
|
name = path + name if name !~ /^(https?:|ftp:)/
|
|
103
103
|
content = open(name,{ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
|
|
@@ -107,8 +107,12 @@ module Nokogiri
|
|
|
107
107
|
content
|
|
108
108
|
end
|
|
109
109
|
x = ele.replace insert
|
|
110
|
-
x.
|
|
111
|
-
|
|
110
|
+
if x.is_a? Nokogiri::XML::Element
|
|
111
|
+
x.do_xinclude_manual(relative_to)
|
|
112
|
+
else
|
|
113
|
+
x.each do |n|
|
|
114
|
+
n.do_xinclude_manual(relative_to) if n.is_a? Nokogiri::XML::Element
|
|
115
|
+
end
|
|
112
116
|
end
|
|
113
117
|
end
|
|
114
118
|
end
|
data/xml-smart.gemspec
CHANGED