Method: Representable::XML.Node

Defined in:
lib/representable/xml/binding.rb

.Node(document, name, attributes = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/representable/xml/binding.rb', line 5

module_function def Node(document, name, attributes={})
  node = Nokogiri::XML::Node.new(name.to_s, document) # Java::OrgW3cDom::DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

  attributes.each { |k, v| node[k] = v } # TODO: benchmark.
  node
end