David Kahn wrote:
> Got a question hopefully someone can answer -
> 
> I am working on functionality to match on certain nodes of a largish 
> (65mb)
> xml file. I implemented this with REXML and was 2 minutes and counting
> before I killed the process. After this, I just opened the console and
> loaded the file into a string and did a regex search for my data -- the
> result was almost instantaneous.
> 
> The question is, if I can get away with it, am I better off just going 
> the
> regex route, or is it really worth my while to investigate a faster XML
> parser (I know REXML is notorious for being slow,

Then why the heck are you even bringing it up in this situation?  I 
*think* Nokogiri is supposed to be much faster.

> but given how fast it 
> was
> to call a regex on the file, I am thinking that this will still be 
> faster
> than all parsers).

Who cares how fast it is if it's inaccurate?  Regular expressions are 
the wrong tool for parsing XML, because they can't cope easily (or at 
all) with lots of valid XML constructs.  If you're parsing XML, use an 
actual XML parser, or you risk serious errors.

> 
> Any comments or suggestions appreciated.
> 
> David

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to