Class: Canon::Xml::Processor
- Inherits:
-
Object
- Object
- Canon::Xml::Processor
- Defined in:
- lib/canon/xml/processor.rb
Overview
C14N 1.1 processor Processes XPath data model and generates canonical form
Instance Method Summary collapse
-
#initialize(with_comments: false) ⇒ Processor
constructor
A new instance of Processor.
-
#process(root_node) ⇒ Object
Process a node-set and generate canonical form.
Constructor Details
#initialize(with_comments: false) ⇒ Processor
Returns a new instance of Processor.
13 14 15 16 17 18 19 |
# File 'lib/canon/xml/processor.rb', line 13 def initialize(with_comments: false) @with_comments = with_comments @encoder = CharacterEncoder.new @namespace_handler = NamespaceHandler.new(@encoder) @attribute_handler = AttributeHandler.new(@encoder) @xml_base_handler = XmlBaseHandler.new end |
Instance Method Details
#process(root_node) ⇒ Object
Process a node-set and generate canonical form
22 23 24 25 26 |
# File 'lib/canon/xml/processor.rb', line 22 def process(root_node) output = String.new(encoding: "UTF-8") process_node(root_node, output) output end |