def partition_namespace_decls(attrs)
      nonns_attrs = []
      ns_bindings = []
      attrs.each do |name, value| 
        local_part, prefix = split_qname(name)
        if prefix && prefix=="xmlns"
          ns_bindings << [local_part, value]
        elsif !prefix && local_part=="xmlns"
          ns_bindings << ["", value]
        else
          nonns_attrs << [name, value]
        end
      end
      [Hash[nonns_attrs], Hash[ns_bindings]]
    end
def partition_namespace_decls(attrs)
      nonns_attrs = []
      ns_bindings = []
      attrs.each do |name, value| 
        local_part, prefix = split_qname(name)
        if prefix && prefix=="xmlns"
          ns_bindings << [local_part, value]
        elsif !prefix && local_part=="xmlns"
          ns_bindings << ["", value]
        else
          nonns_attrs << [name, value]
        end
      end
      [Hash[nonns_attrs], Hash[ns_bindings]]
    end
split attributes into non-namespace related attrs and {prefix=>uri} namespace bindings