On Sun, Mar 18, 2007 at 01:18:33PM -0400, MenTaLguY wrote:
> 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.

The question for me is...  why do we use all this searching after just
creating a template based on variables.  Can't we just put these in the
string directly?  I don't see the point IMO.  Well, maybe this seems (or
seemed at the time) more elegant, but with the NS code you write above,
it becomes QUITE a hassle to put some link in an attribute.  Opinions?

Regards,
Paul

-- 
Student @ Eindhoven                         | email: [EMAIL PROTECTED]
University of Technology, The Netherlands   | JID: [EMAIL PROTECTED]
>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Hobix-is-the-way mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/hobix-is-the-way

Reply via email to