Skip to content

Instantly share code, notes, and snippets.

@rafaelss
Created March 15, 2012 19:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelss/2046324 to your computer and use it in GitHub Desktop.
Save rafaelss/2046324 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