Files
2012-02-21 01:15:00 -05:00

1 line
5.5 KiB
JSON

[{"user_id": 29486, "stars": [], "topic_id": 21141, "date_created": 1303688104.840704, "message": "I gave a presentation at a local ruby group about parsing XML but I was not able to sample the audience for how the handle XML processing on a small scale (e.g. one or two elements and attributes) and on a larger scale (e.g. converting the XML to an object). I would love to know how you've handled both cases.", "group_id": 109, "id": 797439}, {"user_id": 2032, "stars": [], "topic_id": 21141, "date_created": 1303717673.6888621, "message": "https://github.com/jnunemaker/crack", "group_id": 109, "id": 800887}, {"user_id": 2032, "stars": [], "topic_id": 21141, "date_created": 1303717667.7889111, "message": "I usually use Crack. It", "group_id": 109, "id": 800886}, {"user_id": 22997, "stars": [], "topic_id": 21141, "date_created": 1303722192.789562, "message": "I\u2019ve been happy with Nokogiri when parsing large XML files.", "group_id": 109, "id": 801581}, {"user_id": 22997, "stars": [], "topic_id": 21141, "date_created": 1303722239.0563779, "message": "Large as in +500mb", "group_id": 109, "id": 801598}, {"user_id": 1208, "stars": [], "topic_id": 21141, "date_created": 1303732675.0745239, "message": "For files in the 10-100kb range, I use both Nokogiri and Hpricot, sometimes with some preprocessing when I have to deal with buggy xml.", "group_id": 109, "id": 802714}, {"user_id": 1208, "stars": [], "topic_id": 21141, "date_created": 1303732756.9699049, "message": "When I work with large files (ie 2 or 3GB +) like I did for http://www.hackerbooks.com, I use libxml SAX reader (see https://gist.github.com/940409).", "group_id": 109, "id": 802717}, {"user_id": 22997, "stars": [], "topic_id": 21141, "date_created": 1303735750.8422911, "message": "@thibaut_barrere Did you have a reason for not using SAX via Nokogiri? (presumably just a thin layer around libxml2?)", "group_id": 109, "id": 802897}, {"user_id": 29786, "stars": [], "topic_id": 21141, "date_created": 1303761909.030714, "message": "Nokogiri is *hot*", "group_id": 109, "id": 806680}, {"user_id": 1208, "stars": [], "topic_id": 21141, "date_created": 1303810459.9387791, "message": "@peterhellberg I had existing code already doing that, I never used Nokogiri for that purpose (but I guess it would work equally)", "group_id": 109, "id": 812161}, {"user_id": 16058, "stars": [], "topic_id": 21141, "date_created": 1303822610.041435, "message": "rexml", "group_id": 109, "id": 813487}, {"user_id": 22997, "stars": [], "topic_id": 21141, "date_created": 1303832206.383451, "message": "@thibaut_barrere Fair enough, and yes it seems to work just fine. (Even though I find XML unpleasant. we've transformed XML to JSON with XSLT", "group_id": 109, "id": 815718}, {"user_id": 1774, "stars": [], "topic_id": 21141, "date_created": 1303917589.80528, "message": "Nokogiri is the way to go", "group_id": 109, "id": 827142}, {"user_id": 2410, "stars": [], "topic_id": 21141, "date_created": 1304073177.4910381, "message": "I was using crack(which wraps rexml) on 280mb file and took about 30min. Using libxml2 bindings took 2 min.", "group_id": 109, "id": 854296}, {"user_id": 7080, "stars": [], "topic_id": 21141, "date_created": 1304126102.8335791, "message": "I love hpricot, but have recently started using nokogiri due to some strange segfaults. Also, you'll need SAX for very large files. IMHO xml files should never be that large though, but somethings are out of your control.", "group_id": 109, "id": 865496}, {"user_id": 22997, "stars": [{"date_created": 1304778925.91978, "user_id": 31561}], "topic_id": 21141, "date_created": 1304221469.458436, "message": "@doki_pen Data is data, you rarely have a say in the size of it. SAX is currently the least painful solution imho.", "group_id": 109, "id": 873761}, {"user_id": 1363, "stars": [], "topic_id": 21141, "date_created": 1304227283.346, "message": "I like Nokogiri", "group_id": 109, "id": 873956}, {"user_id": 1767, "stars": [], "topic_id": 21141, "date_created": 1304251385.5977149, "message": "@peterhellberg But one can choose the format of the data. And XML is definitely the wrong choice for lots of data.", "group_id": 109, "id": 874840}, {"user_id": 22997, "stars": [{"date_created": 1304362103.753792, "user_id": 1767}, {"date_created": 1304778889.946692, "user_id": 31561}, {"date_created": 1305126173.0962429, "user_id": 7080}], "topic_id": 21141, "date_created": 1304352099.815815, "message": "@koraktor Yes, but not always and then it\u2019s good to have a SAX parser in your bag of tricks. I wouldn\u2019t touch XML with a stick, given alternatives.", "group_id": 109, "id": 885061}, {"user_id": 1767, "stars": [], "topic_id": 21141, "date_created": 1304362145.6414821, "message": "Just had to star for that last statement. ;)", "group_id": 109, "id": 887482}, {"user_id": 32476, "stars": [], "topic_id": 21141, "date_created": 1304717444.6673529, "message": "Can you pass a file stream into a nokogiri reader?", "group_id": 109, "id": 946704}, {"user_id": 32918, "stars": [], "topic_id": 21141, "date_created": 1305119921.3335199, "message": "I also like nokogiri for parsing xml. Haven't figured out how to make it use namespaces yet.", "group_id": 109, "id": 1007087}, {"user_id": 1363, "stars": [], "topic_id": 21141, "date_created": 1305138053.860255, "message": "Event-driven parsers are fast but wack", "group_id": 109, "id": 1011589}, {"user_id": 14562, "stars": [], "topic_id": 21141, "date_created": 1305176959.2447441, "message": "XML is so 2001, anyway Nokogiri is always a good choice.", "group_id": 109, "id": 1020080}]