note 82263 added to ref.xml

From: Date: Thu, 03 Apr 2008 07:24:13 +0000
Subject: note 82263 added to ref.xml
Groups: php.notes 
Request: Send a blank email to php-notes+get-137881@lists.php.net to get a copy of this message
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. ---- Server IP: 64.71.164.2 Probable Submitter: 66.82.9.54 ---- Manual Page -- http://www.php.net/manual/en/ref.xml.php Edit -- https://master.php.net/note/edit/82263 Del: integrated -- https://master.php.net/note/delete/82263/integrated Del: useless -- https://master.php.net/note/delete/82263/useless Del: bad code -- https://master.php.net/note/delete/82263/bad+code Del: spam -- https://master.php.net/note/delete/82263/spam Del: non-english -- https://master.php.net/note/delete/82263/non-english Del: in docs -- https://master.php.net/note/delete/82263/in+docs Del: other reasons-- https://master.php.net/note/delete/82263 Reject -- https://master.php.net/note/reject/82263 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137881) next »