# How can i get data from .txt file and .xml file?

**URL:** <https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297>\
**Category:** Ruby\
**Created:** [June 20, 2007, 9:15am UTC](https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297 "2007-06-20T09:15:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 20, 2007, 9:15am UTC](https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297/1 "2007-06-20T09:15:54Z")

</div>

I have .txt file that is .xml format. i using require “rexml/document”  
and include REXML, but i don know how to get data from the .xml file.

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 20, 2007, 9:38am UTC](https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297/2 "2007-06-20T09:38:43Z")

</div>

On 20 Jun 2007, at 16:15, Cool W. wrote:

> I have .txt file that is .xml format. i using require “rexml/document”  
> and include REXML, but i don know how to get data from the .xml file.

Then perhaps start by reading this:

[http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/](http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/)

Alex G.

Bioinformatics Center  
Kyoto University

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 20, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297/3 "2007-06-20T15:20:34Z")

</div>

On Jun 20, 3:38 am, Alex G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 20 Jun 2007, at 16:15, Cool W. wrote:
> 
> > I have .txt file that is .xml format. i using require “rexml/document”  
> > and include REXML, but i don know how to get data from the .xml file.
> 
> Then perhaps start by reading this:
> 
> [http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/](http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/)

I am not the OP, nor do I have an answer for him, but I would like to  
point out that while an API reference is useful as a reference for  
someone already familiar with the library it documents, it is no  
substitute for a tutorial or manual showing how to actually use API  
properly. So merely pointing someone at an API reference is not as  
helpful as you might have intended. I am not familiar with REXML, and  
having clicked the link you gave, I certainly couldn’t begin to figure  
out where to start reading.

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 20, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/how-can-i-get-data-from-txt-file-and-xml-file/107297/4 "2007-06-20T15:42:40Z")

</div>

On Jun 20, 2007, at 8:20 AM, Karl von Laudermann wrote:

> > [http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/](http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/)
> 
> I am not the OP, nor do I have an answer for him, but I would like to  
> point out that while an API reference is useful as a reference for  
> someone already familiar with the library it documents, it is no  
> substitute for a tutorial or manual showing how to actually use API  
> properly.

That page links to a REXML tutorial, though the link doesn’t seem to  
be working for me at the moment.

James Edward G. II
