Timeline for Error when attempting to get XML data
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 31, 2015 at 23:26 | comment | added | Teddy Codes | it returns the everything as expected. | |
| Dec 31, 2015 at 11:24 | comment | added | The fourth bird | I used simplexml_load_string for the demo to load the string in $source. If I look at your code, you want to load xml file(s). Maybe simplexml_load_file returns false when loading the xml. What you could do is verify if $xmlFilePath contains the expected value when the error occurs. When you run the code, is the xml structure in the xml file(s) the same as the xml from your example? | |
| Dec 30, 2015 at 18:44 | comment | added | Teddy Codes | it was multiple warnings, but only one error, it said "fatal error call to undefined function getNamespace() on line 121". Line 121 is the line that $ns is being defined. When i print something, it doesn't print out anything. I was putting the print inside of the for loop. Since this code overwrites, how would i be able to save everything down to a csv file? I also just realized that you did use simplexm_load_string. So all i would have to do is change that to simplexml_load_file? | |
| Dec 30, 2015 at 11:31 | comment | added | The fourth bird | @Robert The code is based on the provided xml in the question. You can see the result in this demo (note that in the demo I've used simplexml_load_string instead of simplexml_load_file. What are the warnings that you get? Is the structure of the xml the same when you get the warnings?) | |
| Dec 30, 2015 at 2:18 | comment | added | Teddy Codes | The code did not work. I am not sure what i am doing wrong. When i run this code it gives me a bunch of warnings. I am not sure what is going on. Could you possibly just write it off of my current code? | |
| Dec 30, 2015 at 1:21 | vote | accept | Teddy Codes | ||
| Dec 30, 2015 at 1:48 | |||||
| Dec 29, 2015 at 21:49 | history | answered | The fourth bird | CC BY-SA 3.0 |