Jump to content

Fatal error: Call to a member function asXML() on a non-objec


Recommended Posts

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>
Edited by mac_gyver
removed tiny font and added code tags
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.