def compact_qname(ns_stack, name)
      return name if name.is_a?(String)

      local_part, prefix, uri = name
      raise "invalid name: #{name}" if !prefix && uri
      if prefix
        if prefix!="xmlns"
          ns = find_namespace_uri(ns_stack, prefix, uri)
          raise "namespace prefix not bound to a namespace: '#{prefix}'" if ! ns
        end
        [prefix, local_part].map{|s| s.to_s unless s.to_s.empty?}.compact.join(':')
      else
        local_part
      end
    end
def compact_qname(ns_stack, name)
      return name if name.is_a?(String)

      local_part, prefix, uri = name
      raise "invalid name: #{name}" if !prefix && uri
      if prefix
        if prefix!="xmlns"
          ns = find_namespace_uri(ns_stack, prefix, uri)
          raise "namespace prefix not bound to a namespace: '#{prefix}'" if ! ns
        end
        [prefix, local_part].map{|s| s.to_s unless s.to_s.empty?}.compact.join(':')
      else
        local_part
      end
    end
produce a QName String from a [LocalPart, prefix, URI] triple