#30920 [Bgs->Csd]: SimpleXML : tags with "xs:" prefix
ID: 30920 User updated by: hieu at laposte dot net Reported By: hieu at laposte dot net -Status: Bogus +Status: Closed Bug Type: XML related Operating System: windows xp PHP Version: 5.0.2 New Comment: OK i understand now. Sorry. Thank you. Previous Comments: [2004-12-01 23:20:46] [EMAIL PROTECTED] Please read the text and the next example from the article, too. [2004-12-01 20:59:07] hieu at laposte dot net I use the example found in the article above, and i get the error again. For me it is a bug. syndic.xml = http://www.edwardbear.org/serendipity/";> RPROF - Regular Expression Profiler Advanced PHP Programming blog->entry as $entry) { printf("%s\n", $entry->name); } ?> What i only get is : Warning: Invalid argument supplied for foreach() in c:\home\www\ado\txml.php on line 3 [2004-11-29 07:05:32] [EMAIL PROTECTED] read the article mentioned above at zend, especially the part about namespaces.. It's not a bug. You have to use the method "children()" ------------ [2004-11-28 20:26:04] hieu at laposte dot net print_r doesn't work correctly with simplexml, okay... but please read this new code, it doesn't use print_r and shows the same bug : bug.xsd = http://www.w3.org/2001/XMLSchema";> $xml = simplexml_load_file("bug.xsd"); $elt = $xml->element; $attr = (string) $elt['name']; echo $attr; => nothing is printed... if i remove the "xs:" prefix in the xsd file, this same code displays : "dataset" [2004-11-28 12:07:14] [EMAIL PROTECTED] print_r and var_dump don't work reliably on simplexml objects... do *not* use them or even rely on them... And see http://www.zend.com/php5/articles/php5-simplexml.php for more info about SimpleXML and Namespaces The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30920 -- Edit this bug report at http://bugs.php.net/?id=30920&edit=1
#30920 [Bgs]: SimpleXML : tags with "xs:" prefix
ID: 30920 User updated by: hieu at laposte dot net Reported By: hieu at laposte dot net Status: Bogus Bug Type: XML related Operating System: windows xp PHP Version: 5.0.2 New Comment: I use the example found in the article above, and i get the error again. For me it is a bug. syndic.xml = http://www.edwardbear.org/serendipity/";> RPROF - Regular Expression Profiler Advanced PHP Programming blog->entry as $entry) { printf("%s\n", $entry->name); } ?> What i only get is : Warning: Invalid argument supplied for foreach() in c:\home\www\ado\txml.php on line 3 Previous Comments: [2004-11-29 07:05:32] [EMAIL PROTECTED] read the article mentioned above at zend, especially the part about namespaces.. It's not a bug. You have to use the method "children()" ------------ [2004-11-28 20:26:04] hieu at laposte dot net print_r doesn't work correctly with simplexml, okay... but please read this new code, it doesn't use print_r and shows the same bug : bug.xsd = http://www.w3.org/2001/XMLSchema";> $xml = simplexml_load_file("bug.xsd"); $elt = $xml->element; $attr = (string) $elt['name']; echo $attr; => nothing is printed... if i remove the "xs:" prefix in the xsd file, this same code displays : "dataset" [2004-11-28 12:07:14] [EMAIL PROTECTED] print_r and var_dump don't work reliably on simplexml objects... do *not* use them or even rely on them... And see http://www.zend.com/php5/articles/php5-simplexml.php for more info about SimpleXML and Namespaces -------- [2004-11-27 17:55:59] hieu at laposte dot net Description: When the xml file contains this "xs:" prefix, the file is not correctly parsed. Reproduce code: --- The XML file is : http://www.w3.org/2001/XMLSchema"; xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> data:IsDataSet="true"; msdata:Locale="fr-FR";> ... Php 5 code : $oXml = simplexml_load_file($sFileName); print_r($oXml->element); // doesn't work, nothing printed... PS : this code works correctly : $oXml = simplexml_load_file($sFileName); $aXml = get_object_vars($oXml); print_r($aXml['element']); // ok i can now access the "element". Expected result: SimpleXMLElement Object ( [complexType] => SimpleXMLElement Object ( . ) ) Actual result: -- SimpleXMLElement Object ( ) -- Edit this bug report at http://bugs.php.net/?id=30920&edit=1
#30920 [Bgs]: SimpleXML : tags with "xs:" prefix
ID: 30920 User updated by: hieu at laposte dot net Reported By: hieu at laposte dot net Status: Bogus Bug Type: XML related Operating System: windows xp PHP Version: 5.0.2 New Comment: print_r doesn't work correctly with simplexml, okay... but please read this new code, it doesn't use print_r and shows the same bug : bug.xsd = http://www.w3.org/2001/XMLSchema";> $xml = simplexml_load_file("bug.xsd"); $elt = $xml->element; $attr = (string) $elt['name']; echo $attr; => nothing is printed... if i remove the "xs:" prefix in the xsd file, this same code displays : "dataset" Previous Comments: [2004-11-28 12:07:14] [EMAIL PROTECTED] print_r and var_dump don't work reliably on simplexml objects... do *not* use them or even rely on them... And see http://www.zend.com/php5/articles/php5-simplexml.php for more info about SimpleXML and Namespaces -------------------- [2004-11-27 17:55:59] hieu at laposte dot net Description: When the xml file contains this "xs:" prefix, the file is not correctly parsed. Reproduce code: --- The XML file is : http://www.w3.org/2001/XMLSchema"; xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> data:IsDataSet="true"; msdata:Locale="fr-FR";> ... Php 5 code : $oXml = simplexml_load_file($sFileName); print_r($oXml->element); // doesn't work, nothing printed... PS : this code works correctly : $oXml = simplexml_load_file($sFileName); $aXml = get_object_vars($oXml); print_r($aXml['element']); // ok i can now access the "element". Expected result: SimpleXMLElement Object ( [complexType] => SimpleXMLElement Object ( . ) ) Actual result: -- SimpleXMLElement Object ( ) -- Edit this bug report at http://bugs.php.net/?id=30920&edit=1
#30920 [NEW]: SimpleXML : tags with "xs:" prefix
From: hieu at laposte dot net Operating system: windows xp PHP version: 5.0.2 PHP Bug Type: XML related Bug description: SimpleXML : tags with "xs:" prefix Description: When the xml file contains this "xs:" prefix, the file is not correctly parsed. Reproduce code: --- The XML file is : http://www.w3.org/2001/XMLSchema"; xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> data:IsDataSet="true"; msdata:Locale="fr-FR";> ... Php 5 code : $oXml = simplexml_load_file($sFileName); print_r($oXml->element); // doesn't work, nothing printed... PS : this code works correctly : $oXml = simplexml_load_file($sFileName); $aXml = get_object_vars($oXml); print_r($aXml['element']); // ok i can now access the "element". Expected result: SimpleXMLElement Object ( [complexType] => SimpleXMLElement Object ( . ) ) Actual result: -- SimpleXMLElement Object ( ) -- Edit bug report at http://bugs.php.net/?id=30920&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30920&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30920&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30920&r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=30920&r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=30920&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30920&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30920&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30920&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30920&r=support Expected behavior: http://bugs.php.net/fix.php?id=30920&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30920&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30920&r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=30920&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30920&r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=30920&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30920&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30920&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30920&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30920&r=mysqlcfg