Class: Moxml::C14n::AttributeHandler
- Inherits:
-
Object
- Object
- Moxml::C14n::AttributeHandler
- Defined in:
- lib/moxml/c14n/attribute_handler.rb
Overview
Attribute axis handler for inclusive C14N. Implements W3C C14N 1.0 §2.4 / 1.1 §2.4 attribute rendering, including resolution of simple inheritable attributes (xml:lang, xml:space) for document subsets.
Instance Attribute Summary collapse
-
#encoder ⇒ Object
readonly
Returns the value of attribute encoder.
Instance Method Summary collapse
-
#initialize(encoder) ⇒ AttributeHandler
constructor
A new instance of AttributeHandler.
- #process_attributes(element, output, omitted_ancestors = []) ⇒ Object
Constructor Details
#initialize(encoder) ⇒ AttributeHandler
Returns a new instance of AttributeHandler.
12 13 14 |
# File 'lib/moxml/c14n/attribute_handler.rb', line 12 def initialize(encoder) @encoder = encoder end |
Instance Attribute Details
#encoder ⇒ Object (readonly)
Returns the value of attribute encoder.
10 11 12 |
# File 'lib/moxml/c14n/attribute_handler.rb', line 10 def encoder @encoder end |
Instance Method Details
#process_attributes(element, output, omitted_ancestors = []) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/moxml/c14n/attribute_handler.rb', line 16 def process_attributes(element, output, omitted_ancestors = []) return unless element.in_node_set? attributes = collect_attributes(element, omitted_ancestors) attributes.each do |attr| output << " " output << attr.qname output << '="' output << encoder.encode_attribute(attr.value) output << '"' end end |