Forum: Ruby Help with Nokogiri

4d9799c1449040981a902892f9f4f915?d=identicon&s=25 Paul K. (paul_k)
on 2013-11-12 17:46
Hi !
I'm currently trying to parse this XML :
http://leapxl.com/special/xml-rss2.xml
(In french)
I added the START and STOP tags.

I just want to get an array with everything between START and STOP, for
each <item>
If it's not clear enough, just go here :
http://leapxl.com/special/xml-rss.xml
Everything between START and STOP, in an array.

Thanks in advance !
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2013-11-12 18:00
(Received via mailing list)
On Nov 12, 2013, at 10:46 AM, Paul K. <lists@ruby-forum.com> wrote:

> Everything between START and STOP, in an array.
>
> Thanks in advance !
>
> --
> Posted via http://www.ruby-forum.com/.

What code have you got so far, and how is it not working?
4d9799c1449040981a902892f9f4f915?d=identicon&s=25 Paul K. (paul_k)
on 2013-11-12 18:08
I got this :
frdoc = Nokogiri::XML( open("http://www.dicocitations.com/xml-rss2.php")
)
frcits = doc.xpath('//description')

But it's not complete, it lacks the CDATA (and everything after </br>)
suppression.
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2013-11-12 21:25
(Received via mailing list)
On Tue, 2013-11-12 at 18:08 +0100, Paul K. wrote:

> I got this :
> frdoc = Nokogiri::XML( open("http://www.dicocitations.com/xml-rss2.php")
> )
> frcits = doc.xpath('//description')
>
> But it's not complete, it lacks the CDATA (and everything after </br>)
> suppression.
>

frcits.each do |ea|
  puts ea.name
  puts ea.children
end
--
If you have received the message in error, please advise the sender by
reply email and please delete the message.  This message contains
information which may be confidential or otherwise protected.  Unless
you are the addressee (or authorized to receive for the addressee), you
may not use, copy, or disclose to anyone the message or any information
contained in the message.
4d9799c1449040981a902892f9f4f915?d=identicon&s=25 Paul K. (paul_k)
on 2013-11-13 07:39
OK thanks, I'll try it this evening
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.