Class: Canon::Xml::XmlBaseHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/canon/xml/xml_base_handler.rb

Overview

Handler for xml:base fixup in document subsets Implements RFC 3986 URI joining with C14N 1.1 modifications

Instance Method Summary collapse

Instance Method Details

#fixup_xml_base(element, omitted_ancestors) ⇒ Object

Perform xml:base fixup on an element Returns the fixed-up xml:base value or nil if no fixup needed



12
13
14
15
16
17
18
19
20
21
# File 'lib/canon/xml/xml_base_handler.rb', line 12

def fixup_xml_base(element, omitted_ancestors)
  return nil if omitted_ancestors.empty?

  # Collect xml:base values from omitted ancestors
  base_values = collect_base_values(element, omitted_ancestors)
  return nil if base_values.empty?

  # Join the base values in reverse document order
  join_base_values(base_values)
end