Click here to Skip to main content
15,881,588 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: Track traffic sources using PHP get? Pin
GregStevens6-Jul-11 15:18
GregStevens6-Jul-11 15:18 
AnswerRe: Track traffic sources using PHP get? Pin
DLChambers9-Jul-11 14:43
DLChambers9-Jul-11 14:43 
QuestionProblem in integrating php with apache under window 7 environment Pin
nishant rawat5-Jul-11 21:28
nishant rawat5-Jul-11 21:28 
AnswerRe: Problem in integrating php with apache under window 7 environment Pin
Claudio Ludovico Panetta29-Jul-11 6:06
Claudio Ludovico Panetta29-Jul-11 6:06 
QuestionPHP installation Pin
Member 415987129-Jun-11 19:43
Member 415987129-Jun-11 19:43 
AnswerRe: PHP installation Pin
enhzflep1-Jul-11 0:01
enhzflep1-Jul-11 0:01 
AnswerRe: PHP installation Pin
Joan M6-Jul-11 23:21
professionalJoan M6-Jul-11 23:21 
Questionsimplexml_load_string returning empty structure, no errors. why? Pin
GregStevens29-Jun-11 4:30
GregStevens29-Jun-11 4:30 
I have a string variable $xml which contains this string:
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:sumo="http://www.ontologyportal.org/translations/SUMO.owl.txt#" xmlns:dul="http://www.loa-cnr.it/ontologies/DUL.owl" xmlns:owl="http://www.w3.org/2002/07/owl" xmlns:top="http://talkingowlproject.com/schemas/top-level-concepts-10/" xmlns:wps="http://talkingowlproject.com/schemas/wordnet-parser-schema-10/"><rdf:Description rdf:id="#me">
<rdfs:label>Pigwidgeon</rdfs:label>
<rdf:type rdf:resource="http://talkingowlproject.com/schemas/top-level-concepts-10/TalkingOwl" />
</rdf:Description>
<rdf:Description rdf:id="#you">
<rdfs:label>greg</rdfs:label>
<rdf:type rdf:resource="http://talkingowlproject.com/schemas/top-level-concepts-10/User" />
</rdf:Description></rdf:rdf>


I have the following code:
$xmlobj = simplexml_load_string($xml);
if ($xmlobj===false) die('bad news');
print_r($xmlobj);


The result displayed is (appears to be?) an empty structure:
SimpleXMLElement Object
(
)


And when I try to iterate over members of the object, it performs no iterations (confirming that the structure is empty).

Is there something wrong with the XML string? Is there a problem because of the namespace declarations or the use of namespaces on every tag? When I remove the namespace declarations in the root tag, I actually get a structure with contents .... but then it doesn't know the namespaces, so it can't use them when I'm parsing the object. (I need to be able to identify namespaces with nodes.)

Thank you for your help.

--Greg
AnswerRe: simplexml_load_string returning empty structure, no errors. why? PinPopular
GregStevens30-Jun-11 11:35
GregStevens30-Jun-11 11:35 
GeneralRe: simplexml_load_string returning empty structure, no errors. why? Pin
Peter_in_278030-Jun-11 14:51
professionalPeter_in_278030-Jun-11 14:51 
GeneralRe: simplexml_load_string returning empty structure, no errors. why? Pin
GregStevens6-Jul-11 15:18
GregStevens6-Jul-11 15:18 
QuestionGet & show data using CURL Pin
ahmed0181126-Jun-11 18:33
ahmed0181126-Jun-11 18:33 
QuestionHow to include a Javascript variable inside a php function? Pin
Glen Villar24-Jun-11 12:58
Glen Villar24-Jun-11 12:58 
AnswerRe: How to include a Javascript variable inside a php function? Pin
Graham Breach25-Jun-11 2:52
Graham Breach25-Jun-11 2:52 
AnswerRe: How to include a Javascript variable inside a php function? Pin
GregStevens6-Jul-11 15:29
GregStevens6-Jul-11 15:29 
QuestionPHP with Drupal Pin
CodingLover23-Jun-11 19:17
CodingLover23-Jun-11 19:17 
AnswerRe: PHP with Drupal Pin
Peter_in_278023-Jun-11 19:26
professionalPeter_in_278023-Jun-11 19:26 
GeneralRe: PHP with Drupal Pin
CodingLover23-Jun-11 19:41
CodingLover23-Jun-11 19:41 
AnswerRe: PHP with Drupal Pin
CodingLover24-Jun-11 16:01
CodingLover24-Jun-11 16:01 
QuestionPython Threading.Timer Executes Immediately Pin
icemclean21-Jun-11 10:07
icemclean21-Jun-11 10:07 
AnswerRe: Python Threading.Timer Executes Immediately Pin
etkid8425-Aug-11 3:39
etkid8425-Aug-11 3:39 
QuestionI want to learn whow to make like that project. Pin
rabbyweb16-Jun-11 12:50
rabbyweb16-Jun-11 12:50 
AnswerRe: I want to learn whow to make like that project. Pin
walterhevedeich16-Jun-11 15:38
professionalwalterhevedeich16-Jun-11 15:38 
Questionsimulated annealing for distribution in php Pin
wahyu oke14-Jun-11 9:58
wahyu oke14-Jun-11 9:58 
QuestionI urgently need an online exam or test script Pin
E.O.Akinyemi13-Jun-11 13:53
E.O.Akinyemi13-Jun-11 13:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.