The problem is I am using SimpleXMLElement which does not work the
same as DOMDocument, for example it does not have a
SimpleXMLElement::appendChild()
Any other ideas?

On Jul 14, 11:24 am, Alain Vongsouvanh <[email protected]> wrote:
> Hello,
>
> You might find this documentation 
> interesting:http://www.ibm.com/developerworks/opensource/library/x-phpgoogleconta...
>
> Reading from the example, the way you would add a structured postal address
> would be like this:
>
> $doc  = new DOMDocument();
> $doc->formatOutput = true;
> $addr = $doc->createElement('gd:structuredPostalAddress');
> $formatted_address = $doc->createElement('gd:formattedAddress',
> $formatted_address);
>
> $addr->appendChild($formatted_address);
>
> $addr->setAttribute('primary', 'true');
>
> $gcontact->appendChild($addr);
>
> Best,
> Alain
>
> On Wed, Jul 13, 2011 at 10:39 AM, TearsForNations <[email protected]>wrote:
>
>
>
>
>
>
>
>
>
> > Hello,
> > I am trying to append an address to the XML before sending an edit/
> > update request.
> > Here is what i have got
>
> >       $addr = $gcontact->xml->addChild('gd:structuredPostalAddress');
> >       $addr->addChild('gd:formattedAddress', $formatted_address);
> >       $addr->addAttribute('primary', true);
> >       echo 'after setaddress xml: '.$gcontact->xml->saveXML();
>
> > however, saveXML does not reflect the address and does not even
> > contain gd:structuredPostalAddress
>
> > Jim
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
> > To post to this group, send email to
> > [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://code.google.com/apis/contacts/community/forum.html
>
> --
> Alain Vongsouvanh

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to