    # File lib/nokogiri/xml/node.rb, line 324
          def namespaces
            Hash[*namespace_definitions.map { |nd|
              key = ['xmlns', nd.prefix].compact.join(':')
              if RUBY_VERSION >= '1.9' && document.encoding
                begin
                  key.force_encoding document.encoding
                rescue ArgumentError
                end
              end
              [key, nd.href]
            }.flatten]
          end