# File lib/xml/dom2/node.rb, line 160 def childNodes=(p) if p.nil? || (p.is_a?(Array) && p.length == 0) return end if @children.nil? @children = NodeList.new else @children.to_a.clear end p.flatten! p.each do |child| if child.is_a?(String) c = Text.new(child) @children.push(c) c.parentNode = self elsif child.is_a?(Node) @children.push(child) child.parentNode = self else raise "parameter error" end end if p end