Skip to content

Instantly share code, notes, and snippets.

@pbruna
Forked from rafaelss/gist:2046324
Created July 8, 2012 02:44
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 pbruna/3069088 to your computer and use it in GitHub Desktop.
Save pbruna/3069088 to your computer and use it in GitHub Desktop.
XML c14n with Nokogiri
require "nokogiri"
xmldoc = Nokogiri::XML(File.read(ARGV[0]), nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::NOCDATA | Nokogiri::XML::ParseOptions::STRICT)
print xmldoc.at(ARGV[1]).canonicalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment