# Using XmlSimple to parse XML strings

**URL:** <https://www.ruby-forum.com/t/using-xmlsimple-to-parse-xml-strings/190169>\
**Category:** Rails\
**Created:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/using-xmlsimple-to-parse-xml-strings/190169 "2010-06-17T16:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ab992/32.png) [@djames](https://www.ruby-forum.com/u/djames)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/using-xmlsimple-to-parse-xml-strings/190169/1 "2010-06-17T16:22:08Z")

</div>

I am using XmlSimple to parse an XML string received from a remote  
host. I am getting the error message, “File does not exist: .”. I am  
fairly well convinced that the problem is that XmlSimple is not  
recognizing the received XML string as being valid XML and is  
therefore looking for a file by that name (which, of course, does not  
exist). The XmlSimple documentation says that it recognizes an XML  
string by the presence of ‘\<’ and ‘\>’ characters. I interpret that to  
mean that XmlSimple does not perform any sort of exhaustive XML  
validity check; but, rather just looks for the presence of those  
opening and closing characters to make the determination. The  
received string meets that requirement. Any suggestions on what I  
might do?

Thanks for any input.

```
      ... doug
```

---

<div class="post-metadata">

**Author:** ![djames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ab992/32.png) [@djames](https://www.ruby-forum.com/u/djames)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/using-xmlsimple-to-parse-xml-strings/190169/2 "2010-06-17T16:22:33Z")

</div>

I wanted the list to know that I resolved this issue. My problem  
related to my poor understanding of sockets (but I’m learning). I  
didn’t realize that reading from a socket is destructive. That is  
(apparently) once the data is read from the socket, it is gone. In a  
backhanded sort of way, that is what was causing my problem. Thanks.

```
     ... doug
```
