6

Looking for something similar to xerces for parsing an xml file in ruby. I saw the native processor REXML and another called hpricot (though I can't find any documentation on hpricot, the links all appear to be dead). I'm looking for something that would parse an xml document via SAX2 in ruby.

TIA.

jmq
  • 10,110
  • 16
  • 58
  • 71
  • Most of the hpricot links are broken because _why was the developer, and he managed to almost completely remove himself from the internet a few weeks ago. GitHub has a mirror up now (http://github.com/whymirror/hpricot/tree/master) – Shawn Craver Sep 03 '09 at 13:13

3 Answers3

9

I've been successful with the Nokogiri SAX Parser

Rob Di Marco
  • 43,054
  • 9
  • 66
  • 56
  • 1
    Nokogiri really is the best thing out there. It's nice and clean, without too much magic. – Skade Sep 04 '09 at 23:30
1

Apart from those already mentioned, the other mainstream alternative is probably LibXML

Mike Woodhouse
  • 51,832
  • 12
  • 88
  • 127
0

There are two fast BLAST XML parsers for Ruby, which are easy to understand examples of iterative lazy parsing, using a C extension for the low-level XML parsing. Both are based on libxml2 and Nokogiri. Nokogiri because the performance rocks. See http://biogems.info to find the two parsers.

pjotrp
  • 2,547
  • 1
  • 15
  • 4