CDYK Posted April 4, 2014 Share Posted April 4, 2014 can anybody help me out.I am gettin an error stated as:error:Fatal error: Call to a member function asXML() on a non-objec <?php $projectXML = simplexml_load_string($_POST["projectXML"]); $sxe = new SimpleXMLElement($projectXML->asXML(),null,true); $sxe->registerXPathNamespace('n', 'https://kanbanflow.com/board/a01f59dbfc653e60e6af4a1ad43e30d0'); //$result = $sxe->xpath('/n:Project/n:Tasks/n:Task[n:UID[text()="0"]]'); $title = $result[0]->Name; header('Content-type: text/html'); echo $sxe->asXML(); ?> <html> <head> <title>Gantter UI Extension Example</title> </head> <body> <h1>Gantter UI Extension Example</h1> Your email address is: <b><?php echo $_POST["email"]?></b> <br/> You were working in the <b><?php echo $_POST["currentWorkspace"] ?> workspace</b> <br/> The project title is: <b><?php echo $title ?></b> <br/> These rows were selected: <b><?php echo $_POST["selectedItems"] ?></b> <br/> </body> </html> Link to comment https://forums.phpfreaks.com/topic/287511-fatal-error-call-to-a-member-function-asxml-on-a-non-objec/ Share on other sites More sharing options...
trq Posted April 4, 2014 Share Posted April 4, 2014 $projectXML isn't what you think it is. I would say your call to simplexml_load_string() is failing. Link to comment https://forums.phpfreaks.com/topic/287511-fatal-error-call-to-a-member-function-asxml-on-a-non-objec/#findComment-1474920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.