On Sun, 2007-03-18 at 01:00 +0100, Paul van Tilburg wrote:
> On Sat, Mar 17, 2007 at 12:43:16AM -0400, MenTaLguY wrote:
> > On Fri, 2007-03-16 at 10:28 -0700, MenTaLguY wrote:
> > > rssdoc.elements['/atom:feed/atom:[EMAIL PROTECTED]"alternate"]', {
> > > 'atom'
> > > => "http://www.w3.org/2005/Atom" }].attributes['href']
> >
> > It looks like we must use XPath.first here.
>
> What doe you mean, exactly?
require 'rexml/xpath'
...
REXML::XPath.first( rssdoc.elements, '/atom:feed/atom:[EMAIL
PROTECTED]"alternate"]', { 'atom' => "http://www.w3.org/2005/Atom" } )
The 1.8.6 behavior is more compliant -- XPath is not supposed to match
namespaced elements without using a prefix bound to the right namespace.
Sadly, it turns out there's no way to specify namespaces when using
REXML::Elements#[], so REXML::XPath is the only way to go if you want
namespace support.
-mental
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Hobix-is-the-way mailing list [email protected] http://rubyforge.org/mailman/listinfo/hobix-is-the-way
