Skip to content

Instantly share code, notes, and snippets.

@arikon
Created October 10, 2010 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arikon/619175 to your computer and use it in GitHub Desktop.
Save arikon/619175 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
libxml = require('o3-xml');
var snippetXml = '<snippet><name>Sergey Belov</name><phone>+71111111111</phone><car>Ford Mondeo</car></snippet>',
snippetDoc = libxml.parseFromString(snippetXml),
xml = '<root><group><doc id="123"/></group></root>',
doc = libxml.parseFromString(xml);
// throws exception
doc.documentElement.selectSingleNode('group/doc').appendChild(snippetNode.documentElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment