# Looking for XML parsers in Ruby

**URL:** <https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454>\
**Category:** Ruby\
**Created:** [January 29, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454 "2008-01-29T12:20:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 29, 2008, 12:20pm UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/1 "2008-01-29T12:20:13Z")

</div>

Hi,

I am looking for a validating XML parser for ruby. I found that there  
are libxml-ruby and ruby interface to expat available. Could someone  
please tell me  
which is the better in terms of performance and functionality? I am  
looking for a parser that is stable and has good performance.

Regards,  
Ravindra

---

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 29, 2008, 1:55pm UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/2 "2008-01-29T13:55:48Z")

</div>

Ravindra Kumar wrote:

> Hi,
> 
> I am looking for a validating XML parser for ruby. I found that there  
> are libxml-ruby and ruby interface to expat available. Could someone  
> please tell me  
> which is the better in terms of performance and functionality? I am  
> looking for a parser that is stable and has good performance.
> 
> Regards,  
> Ravindra

I searched the archives and found this:  
[http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html](http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html)

Maybe you just typed in the wrong thing to search for and missed this.

---

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 29, 2008, 3:06pm UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/3 "2008-01-29T15:06:05Z")

</div>

On Jan 29, 5:55 pm, Lloyd L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Ravindra
> 
> I searched the archives and found this:[REXML: Processing XML in Ruby](http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html)
> 
> ## Maybe you just typed in the wrong thing to search for and missed this.
> 
> Posted viahttp://www.ruby-forum.com/.

The OP said “validating XML parser”. As I remember, REXML was not yet  
that - when I last used it a while back. Also just checked the REXML  
site that is linked to in the [xml.com](http://xml.com) article URL you quote above;  
unless REXML is now at some other site or the page is not updated, the  
site seems to still show that it is not a validating parser.

- Vasudev Ram  
Dancing Bison Enterprises  
Software consulting and training  
Biz site: [http://www.dancingbison.com](http://www.dancingbison.com)  
Blog (on software innovation): [http://jugad.livejournal.com](http://jugad.livejournal.com)  
Quick and easy PDF creation toolkit:  
[dancingbison.com](http://www.dancingbison.com/products.html)

---

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 30, 2008, 2:19am UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/4 "2008-01-30T02:19:03Z")

</div>

And it’s validating like the OP asked for. Double win!! 🙂

–Jeremy

On Jan 29, 2008 6:55 PM, Bryan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > 
> > 
> > [REXML: Processing XML in Ruby](http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html)
> > 
> > ## Maybe you just typed in the wrong thing to search for and missed this.
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My books:  
Ruby in Practice

> **[Ruby in Practice](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems...

My free Ruby e-book

> **[Site not found · DreamHost](http://www.humblelittlerubybook.com/)**
>
> The owner of this domain has not yet uploaded their website.

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 30, 2008, 11:50am UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/5 "2008-01-30T11:50:21Z")

</div>

Jeremy McAnally wrote:

> And it’s validating like the OP asked for. Double win!! 🙂

Thank you all for your responses. Actually I am aware of libxml-ruby. I  
just wanted to know if there is any better validating parser for ruby  
other than libxml. It would be great if someone could give a brief  
comparison otherwise libxml-ruby is good enough for my purpose.

> –Jeremy
> 
> On Jan 29, 2008 6:55 PM, Bryan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > > 
> > > 
> > > [REXML: Processing XML in Ruby](http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html)
> > > 
> > > ## Maybe you just typed in the wrong thing to search for and missed this.
> > > 
> > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> –  
> [http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)
> 
> My books:  
> Ruby in Practice  
> [Ruby in Practice](http://www.manning.com/mcanally/)
> 
> My free Ruby e-book  
> [http://www.humblelittlerubybook.com/](http://www.humblelittlerubybook.com/)
> 
> My blogs:  
> [http://www.mrneighborly.com/](http://www.mrneighborly.com/)  
> [http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![ravindra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Post date:** [January 30, 2008, 12:56am UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454/6 "2008-01-30T00:56:20Z")

</div>

Don’t use REXML if performance is important to you. libxml-ruby is  
10-100 times faster than REXML.

-Bryan
