aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini.rb
blob: 8ae8e7cefe4e7f3ccb5891867c8ffa91b39f5a14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# = XmlMini
module ActiveSupport
  module XmlMini
    extend self

    CONTENT_KEY = '__content__'.freeze

    # Hook the correct parser into XmlMini
    def hook_parser
      begin
        require 'xml/libxml' unless defined? LibXML
        require "active_support/xml_mini/libxml.rb"
      rescue MissingSourceFile => e
        require "active_support/xml_mini/rexml.rb"
      end
    end

    hook_parser

  end
end