SimpleXML - Call to a member function children() on a non-object

Hello all,

Given the following XML:

<?xml version="1.0" encoding="UTF-8"?>
    <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
            <transfer op="request">
                <domain:transfer xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
                <ptdomain:transfer xmlns:ptdomain="" xsi:schemaLocation=" ptdomain-1.0.xsd">

I was expecting access the name property like so:

$xmlObj = simplexml_load_file(self::PATHXML.'EppTransferDomain.xml');
$xmlObj->comand->transfer->children(self::OBJ_URI_DOMAIN)->transfer->name = $dominioVo->getNome();

Instead, a fatal error occurs:
Call to a member function children() on a non-object

I have dump $xmlObj and it IS an object.

Here’s the dump:

object(SimpleXMLElement)#9 (1) {
  object(SimpleXMLElement)#6 (3) {
    object(SimpleXMLElement)#8 (1) {
      array(1) {
        string(7) "request"
    object(SimpleXMLElement)#11 (0) {
    object(SimpleXMLElement)#12 (0) {

What am I doing wrong this time? :frowning:

Thanks in advance,

Just spot it!! :wink:

AHrrrrhhh!!! Those are the worst. Absolutely!!!

Thanks for looking up. :slight_smile:

How many times does the letter M occur in the word “command”? Think about it … :wink: