xmlmapper 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xmlmapper.rb +7 -3
- data/lib/xmlmapper/version.rb +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: 3a3c14f5e8ceec06b9800e8fbb00d0bd29ca058e
|
4
|
+
data.tar.gz: 7cff1951dc92161e4135523e3ac72624bb965152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86aad8f4b953a940f1ffdcd5b63bda9017d63643c67a3e294493f992e5543c51411646497a21762f6e894a4ffb5e46dcbc00c8ab6119e84ef17b71d71dac8510
|
7
|
+
data.tar.gz: 54aff22c419781eef9dcf5278162b99b83dada707e736fb2de9e0d45ec581a8b648ee02fbf5146f0dee666c237f596c71fb445aa2d806f9cbe543816eaa8973b
|
data/lib/xmlmapper.rb
CHANGED
@@ -435,7 +435,7 @@ module XmlMapper
|
|
435
435
|
# assign the current xml that we just parsed to the xml_value
|
436
436
|
|
437
437
|
if obj.respond_to?('xml_value=')
|
438
|
-
n.namespaces.each {|name,path| n[name] = path }
|
438
|
+
# n.namespaces.each {|name,path| n[name] = path }
|
439
439
|
obj.xml_value = n.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION)
|
440
440
|
end
|
441
441
|
|
@@ -497,6 +497,10 @@ module XmlMapper
|
|
497
497
|
end
|
498
498
|
end
|
499
499
|
|
500
|
+
def registered_namespaces
|
501
|
+
@registered_namespaces ||= self.class.instance_variable_get('@registered_namespaces').dup
|
502
|
+
end
|
503
|
+
|
500
504
|
#
|
501
505
|
# Create an xml representation of the specified class based on defined
|
502
506
|
# XmlMapper elements and attributes. The method is defined in a way
|
@@ -597,8 +601,8 @@ module XmlMapper
|
|
597
601
|
# However, we do not want to add the namespace if the namespace is 'xmlns'
|
598
602
|
# which means that it is the default namesapce of the code.
|
599
603
|
#
|
600
|
-
if
|
601
|
-
|
604
|
+
if registered_namespaces && builder.doc.root
|
605
|
+
registered_namespaces.each_pair do |name,href|
|
602
606
|
name = nil if name == "xmlns"
|
603
607
|
builder.doc.root.add_namespace(name,href)
|
604
608
|
end
|
data/lib/xmlmapper/version.rb
CHANGED