Paul van Tilburg
2007-03-16 11:52:01 UTC
Hello all,
Something odd happened with Hobix after upgrading to Ruby 1.8.6.
Something has changed in the REXML API or a bug has been introduced
breaking the Atom feed generator. The traceback:
/usr/lib/ruby/1.8/hobix/out/atom.rb:59:in `load': undefined method
`attributes' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/hobix/weblog.rb:617:in `retouch'
from /usr/lib/ruby/1.8/hobix/weblog.rb:584:in `each'
...
from /usr/bin/hobix:79
Line 59 of atom.rb is:
59: rssdoc.elements['/feed/link[@rel="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?
Thanks in advance,
Paul
P.S. People on the REXML list, please Cc me, for I am not on the list.
Something odd happened with Hobix after upgrading to Ruby 1.8.6.
Something has changed in the REXML API or a bug has been introduced
breaking the Atom feed generator. The traceback:
/usr/lib/ruby/1.8/hobix/out/atom.rb:59:in `load': undefined method
`attributes' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/hobix/weblog.rb:617:in `retouch'
from /usr/lib/ruby/1.8/hobix/weblog.rb:584:in `each'
...
from /usr/bin/hobix:79
Line 59 of atom.rb is:
59: rssdoc.elements['/feed/link[@rel="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?
Thanks in advance,
Paul
P.S. People on the REXML list, please Cc me, for I am not on the list.
--
Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181