Created
March 15, 2012 19:36
-
-
Save rafaelss/2046324 to your computer and use it in GitHub Desktop.
XML c14n with Nokogiri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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