Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Carole E. Mah
On Jan 18, 2008 12:22 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > Are you trying to read an existing document into a SimpleXMLElement, or are > you trying to create a SimpleXMLElement instance and generate a document > from that? > My impression was you were trying to do the later; please clarify

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Carole E. Mah
>based upon information from bug #43221, if you define the namespace >beforehand >it will work. > >$xml = new SimpleXMLElement('http://apple.com"/>'); >$n = $xml->addChild("subtitle", "Musical Mockery", "http://apple.com";); >print_r($xml->asXml()); >?> > >produces: > >http://apple.com";>Musical >M

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Carole E. Mah
Yes, I tried the following: http://us3.php.net/manual/en/function.dom-domdocument-createelementns.php Same results. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Carole E. Mah
This is problematic code, even though it works, because it auto-generates an unnecessary xmlns: attribute: $item->addChild('itunes:subtitle', $mySubTitle,"itunes"); It generates the following XML: Musical Mockery When really all we want is this: Musical Mockery Furthermore, dumping it into a