note 82263 deleted from ref.xml by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Mar 2010 18:56:35 +0000 |
| Subject: | note 82263 deleted from ref.xml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166629@lists.php.net to get a copy of this message | ||
Note Submitter: shawn dot rapp at gmail dot com
----
Well I posted my script with an example fread($fp, 4096) meaning that it will only read 4k. It was
just for a quick example. If you used that to input data from a really long XML file to the parser
that would be the problem.
you could replace the 4096 with filesize("file.xml") or try replacing that example test
code part with:
$xml = implode('',file("http://localhost/test.xml"));
$xml_parser = new XML_Class();
$xml_parser->parse($xml);
print_r($xml_parser->dom);
I've tried to recreate your problems by posting entire howto of installing LDAP into character
data space of a node and can't get it to fail. Please email with more info if the above
isn't the problem.
But on that routine you posted from that website. The problem with that one is it seems to be
padding with unnecessary arrays. It will overwrite different nodes with the same name if they are
within the same parent. And the number one biggest issue for me is that it drops attributes. That
is totally bogus. It's a lot cleaner to store most values in attributes than making a zillion
nodes and storing the data for something small like a integer or a float as character data.
Example:
<coords x="1.53234" y="56.287" z="4.32" />
VS
<coords><x>1.53234</x><y>56.287</y><z>4.32</z></coords>
To me the top is very readable where the later makes my eyes bleed.
Any ways what is good about the links code is the error checking. Isolating all the code in the
parse method instead of constructor so the object is recyclable. And than releases the xml parser.
I'm definitely going to be putting that stuff into my class after I post this note.
But let me know if its still truncating.