Jump to content

xmlReader not getting all data


jisan

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.