From: Matt Gushee Date: 2002-09-28T02:13:34+09:00 Subject: Re: REXML namespace support On Sat, Sep 28, 2002 at 12:18:28AM +0900, 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. But you have a Document instance, don't you? I was thinking you might be able to do something with XPath, e.g. XPath.match(doc,"namespace-uri(//#{prefix}:*[1])") that doesn't work, though. I'm not sure if namespace-uri() is implemented in REXML or not. And I think in order to use a namespace prefix in XPath, you may have to define it in the context where it is being evaluated. I know you have to do that in XSLT; I'm not sure what the XPath spec requires for stand-alone XPath processing. Oh, well, so much for that idea. You may have to just walk the document tree until you find a match. -- Matt Gushee Englewood, Colorado, USA mgushee@havenrock.com http://www.havenrock.com/