Class: Canon::Xml::C14n
- Inherits:
-
Object
- Object
- Canon::Xml::C14n
- Defined in:
- lib/canon/xml/c14n.rb
Overview
XML Canonicalization 1.1 implementation Per W3C Recommendation: www.w3.org/TR/xml-c14n11/
Class Method Summary collapse
-
.canonicalize(xml, with_comments: false) ⇒ String
Canonicalize an XML document.
-
.canonicalize_subset(xml, _xpath, with_comments: false) ⇒ String
Canonicalize a document subset (for future implementation).
Class Method Details
.canonicalize(xml, with_comments: false) ⇒ String
Canonicalize an XML document
15 16 17 18 19 20 21 22 |
# File 'lib/canon/xml/c14n.rb', line 15 def self.canonicalize(xml, with_comments: false) # Build XPath data model root_node = DataModel.from_xml(xml) # Process to canonical form processor = Processor.new(with_comments: with_comments) processor.process(root_node) end |
.canonicalize_subset(xml, _xpath, with_comments: false) ⇒ String
Canonicalize a document subset (for future implementation)
29 30 31 32 33 |
# File 'lib/canon/xml/c14n.rb', line 29 def self.canonicalize_subset(xml, _xpath, with_comments: false) # TODO: Implement XPath-based subset selection # For now, just canonicalize the whole document canonicalize(xml, with_comments: with_comments) end |