Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug In REXML

0 views
Skip to first unread message

Daniel Sheppard

unread,
Sep 26, 2005, 11:11:25 PM9/26/05
to
I was playing around with REXML and feeding it the RSS feed from
slashdot.

Running this:

require 'rexml/document
REXML::Document.new(open("slashdot.xml")).write

I got output with empty <link> elements:

<item
rdf:about='http://science.slashdot.org/article.pl?sid=05/09/26/1551241&a
mp;from=rss'>
<title>Technology for Capturing 360 Degree Video</title>
<link/>
<dc:creator>ScuttleMonkey</dc:creator>
<dc:date>2005-09-26T18:01:00+00:00</dc:date>
<dc:subject>tech</dc:subject>

<slash:department>even-guesswork-can't-save-most-hollywood-pictures</sla
sh:department>


I'm running ruby from the one-click installer: ruby 1.8.2 (2004-12-25)
[i386-mswin32]

#####################################################################################
This email has been scanned by MailMarshal, an email content filter.
#####################################################################################

Daniel Sheppard

unread,
Sep 27, 2005, 12:09:20 AM9/27/05
to
Okay - I don't think this was rexml's fault. I accidentally inputted
with the file that had the link tags blown away when I did the test in
IRB.

I'm not doing anything much more complicated than that in my other code,
but since that's embedded in mousehole, I'm guessing I've done something
stupid because I don't quite know what I'm doing there. For the record,
what I'm doing is:

document.each_element('//item/') do |e|
e.each_element('description') {|x| x.remove}
doc = read_xhtml_from(e.attributes['rdf:about']
+ "&mode=nocomment")
desc = REXML::Element.new('description')
doc.each_element('//div[@class="intro"]') do |x|
s = ""
x.write(s)
s.gsub!("&mdash;","&#8212;")
desc.text = s
end
e << desc
end

(trying to turn the slashdot feed into something more useful).

I don't see how any of that could have any effect on the <link> element
though.

0 new messages