On Fri, 16 Mar 2007 12:52:01 +0100, Paul van Tilburg <[EMAIL PROTECTED]> wrote:
> Line 59 of atom.rb is:
>  59:  rssdoc.elements['/feed/[EMAIL 
> PROTECTED]"alternate"]'].attributes['href']
> 
> Somehow this XPath query doesn't seem to find the appropriate XML
> element anymore in the following (abbreviated) XML document:
> 
> <feed
>   xmlns="http://www.w3.org/2005/Atom";
>   xmlns:dc="http://purl.org/dc/elements/1.1/";
>   xml:lang="en">
>     <title></title>
>     <link rel="alternate" type="text/html" href="" />
>     <link rel="self" type="application/atom+xml" href="" />
>     ...
> </feed>
> 
> However, when the xmlns attribute of the <feed/> element is removed,
> everyting works fine.  What would be a possible fix or workaround for
> this problem not breaking the spec nor the fact that it should work with
> Ruby 1.8.5 and 1.8.6?

Hmm.  I forget how REXML does namespaces, but I would imagine the query 
probably needs to be something more or less like:

  rssdoc.elements['/atom:feed/atom:[EMAIL PROTECTED]"alternate"]', { 'atom' => 
"http://www.w3.org/2005/Atom"; }].attributes['href']

I'm guessing the old REXML behavior which the existing atom.rb code relies upon 
was a bug.

(I'm also not subscribed to the rexml list, so please CC me)

-mental

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

Reply via email to