# Parse with XML Builder, or use something else (like REXML)?

**URL:** <https://www.ruby-forum.com/t/parse-with-xml-builder-or-use-something-else-like-rexml/71464>\
**Category:** Rails\
**Created:** [October 9, 2006, 5:34am UTC](https://www.ruby-forum.com/t/parse-with-xml-builder-or-use-something-else-like-rexml/71464 "2006-10-09T05:34:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yardboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@yardboy](https://www.ruby-forum.com/u/yardboy)\
**Post date:** [October 9, 2006, 5:34am UTC](https://www.ruby-forum.com/t/parse-with-xml-builder-or-use-something-else-like-rexml/71464/1 "2006-10-09T05:34:42Z")

</div>

I’ve been using XML Builder successfully to create XML documents from  
scratch. I now have to parse out a response document and am not sure if  
Builder has some function to assist in this (which is the reverse of  
what I’ve been doing), or if I should use REXML, or even some other lib.  
REXML looks to do what I want, but I’m confused as to how it relates to  
Builder, and/or vice-versa, or if at all.

Thanks.  
c.

---

<div class="post-metadata">

**Author:** ![yardboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@yardboy](https://www.ruby-forum.com/u/yardboy)\
**Post date:** [October 9, 2006, 6:32am UTC](https://www.ruby-forum.com/t/parse-with-xml-builder-or-use-something-else-like-rexml/71464/2 "2006-10-09T06:32:55Z")

</div>

> I now have to parse out a response document and am not sure if  
> Builder has some function to assist in this (which is the reverse of  
> what I’ve been doing), or if I should use REXML, or even some other  
> lib.  
> REXML looks to do what I want, but I’m confused as to how it  
> relates to  
> Builder, and/or vice-versa, or if at all.

Builder and REXML aren’t related.

That said, REXML is just the ticket for parsing XML. XmlSimple is  
also good, and I actually prefer it in some ways.

This Yahoo! article actually has a good overview of parsing XML in  
Ruby with examples using both REXML and XmlSimple, so you can compare  
the differences in flavour.

[http://developer.yahoo.com/ruby/ruby-xml.html](http://developer.yahoo.com/ruby/ruby-xml.html)

–  
Jeffrey H. (packagethief)

> **[unspace.ca](http://unspace.ca)**
>
> This domain may be for sale!

[http://re.visioni.st](http://re.visioni.st)  
[http://quotedprintable.com](http://quotedprintable.com)

---

<div class="post-metadata">

**Author:** ![yardboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@yardboy](https://www.ruby-forum.com/u/yardboy)\
**Post date:** [October 9, 2006, 2:37pm UTC](https://www.ruby-forum.com/t/parse-with-xml-builder-or-use-something-else-like-rexml/71464/3 "2006-10-09T14:37:53Z")

</div>

THANKS! That’s just the ticket…

c.

Jeffrey H. wrote:

> > I now have to parse out a response document and am not sure if  
> > Builder has some function to assist in this (which is the reverse of  
> > what I’ve been doing), or if I should use REXML, or even some other  
> > lib.  
> > REXML looks to do what I want, but I’m confused as to how it  
> > relates to  
> > Builder, and/or vice-versa, or if at all.
> 
> Builder and REXML aren’t related.
> 
> That said, REXML is just the ticket for parsing XML. XmlSimple is  
> also good, and I actually prefer it in some ways.
> 
> This Yahoo! article actually has a good overview of parsing XML in  
> Ruby with examples using both REXML and XmlSimple, so you can compare  
> the differences in flavour.
> 
> [http://developer.yahoo.com/ruby/ruby-xml.html](http://developer.yahoo.com/ruby/ruby-xml.html)
> 
> –  
> Jeffrey H. (packagethief)  
> [http://unspace.ca](http://unspace.ca)  
> [http://re.visioni.st](http://re.visioni.st)  
> [http://quotedprintable.com](http://quotedprintable.com)
