XML_ParseBuffer keeps returning 4 bytes?
Brian Bisaillon <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, I am new to using expat and I am basically using it for parsing XML configuration files. I configured, compiled and installed the latest version of expat (development version) on Cygwin. I tried to use XML_GetBuffer but whenever I pass it a len, it seems to always return 4 bytes. I found this out after printing a sizeof(buf) after the call to XML_GetBuffer. As a result, read() was only reading the first 4 bytes of my XML configuration file and after that XML_ParseBuffer seemed to do absolutely nothing. I did not get a printout of the XML configuration file. However, when I commented out my call to XML_GetBuffer and changed my call from XML_ParseBuffer to XML_Parse using my own char buffer with a length of 8192, I got the expected results. Now, I am wondering if I did something wrong or if XML_GetBuffer is broken in this release. As I mentioned earlier, I am using Cygwin and have not test ed the same code on Linux. I am waiting for my new machine to come in. I did not try it w! ith the previous stable version of expat either. I basically just overwrote the existing expat on Cygwin. Although, maybe I should remove it, reinstall the development version of expat and try again? I doubt this would cause the problem though. Brian.