lib/xml/mixup.rb in xml-mixup-0.1.8 vs lib/xml/mixup.rb in xml-mixup-0.1.9
- old
+ new
@@ -137,10 +137,11 @@
node = nodes[adj]
# dispatch based on spec type
if spec and not (spec.respond_to? :empty? and spec.empty?)
+ spec = spec.to_a if spec.is_a? Nokogiri::XML::NodeSet
if spec.is_a? Array
par = adj == :parent ? nodes[:parent] : doc.fragment
out = spec.map do |x|
markup(spec: x, parent: par, pseudo: nodes[:parent], doc: doc,
args: nodes[:args])
@@ -344,10 +345,10 @@
end
end
else
if spec.is_a? Nokogiri::XML::Node
# existing node
- node = spec.dup
+ node = spec.dup 1
else
# text node
node = doc.create_text_node spec.to_s
end