Nokogiri keep namespaces when combining XML data

I need to combine the item from multiple XML files into one file. I tried something like this.\[code\]first_doc = Nokogiri::XML(open('output1.xml'))second_doc = Nokogiri::XML(open('output2.xml'))first_doc.xpath("//item").last.after(second_doc.xpath("//item"))\[/code\]However the items have a namespace structure like so:\[code\]<item> <ns: title>title</title></item>\[/code\]The appended data always reverts to:\[code\]<item> <title>title</title></item>\[/code\]I need to combine the items into a single XML document while retaining the namespaces. I've scouring the docs but I'm not really sure what I'm looking for here.
 
Back
Top