From: Bob Hutchison Date: 2002-09-30T23:08:15+09:00 Subject: Re: REXML namespace support On 9/27/02 11:18 AM, "Volkmann, Mark" wrote: > In my case I'm given a string which is a namespace prefix and I want to > determine the namespace it is associated with. I don't have an Element object > so I can't use the namespace method. XML namespaces are defined as xml is processed. The prefix may be reused. For example: is legal (though a questionable practice, and ignoring opinions w.r.t. Namespaces being URLs). In this example there are two namespaces but only one prefix is used. In general, the prefix mapping to namespace is scoped. This makes it impossible to answer the question you want to ask unless you can identify a spot in the document. I know that the parser I wrote for ruby will supply you all in-scope prefix-namespace mappings as it parses an XML file. I assume that REXML will do the same, though I don't know for sure. It occurs to me that it is possible that you miss-understand the requirement on having an element that somebody else mentioned -- any element at all will do (or processing instruction, or comment) *when* *parsing*, regardless of its namespace or prefix, and all in-scope prefixes and namespaces will be available to you. Cheers, Bob