jisan Posted July 26, 2012 Share Posted July 26, 2012 Hi, I have been searching on the internet for hours now without luck so hope you can help me. I am trying to run through an xml stream and just writing out the localNames for each line. But the output stops before it gets to the end, so I'm missing the last couple of lines. My code looks like this: $xmlstr=str_replace("<", "<", $_POST['dataString']); $xmlstr=str_replace(">", ">", $xmlstr); $xmlReader = new XMLReader(); $xmlReader->xml($xmlstr); while($xmlReader->read()) { echo $xmlReader->localName."<br />"; } I have attached a copy of what is in $xmlstr My guesses is that it is some kind of limitation in xmlReader or the server times out or there are something in my data making xmlReader think it should stop. But the date amount is so small I really can't see why it should hit any limits and the response from the server is fairly fast and I have inspected the data many times both visually and with xml verifiers without finding anything so hope someone can help. Thank you in advance. I am running PHP 5.3.14 Best regards Jeppe 18722_.txt Quote Link to comment https://forums.phpfreaks.com/topic/266276-xmlreader-not-getting-all-data/ Share on other sites More sharing options...
Adam Posted July 26, 2012 Share Posted July 26, 2012 A quick validation check on the test file found errors. I'm guessing XMLReader is stopping when it hits that. Quote Link to comment https://forums.phpfreaks.com/topic/266276-xmlreader-not-getting-all-data/#findComment-1364543 Share on other sites More sharing options...
jisan Posted July 26, 2012 Author Share Posted July 26, 2012 Hi Adam, Thanks for your reply. When I run it through w3.org's validator it comes out with out error (copying the text into there input validator as direct input) Please could you let me know what validator that gives you error and maybe what error you get? Thank you Best regards Jeppe Quote Link to comment https://forums.phpfreaks.com/topic/266276-xmlreader-not-getting-all-data/#findComment-1364545 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.