Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Nathan Nobbe
On Jan 18, 2008 2:48 PM, Carole E. Mah <[EMAIL PROTECTED]> wrote: > 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 > > f

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 Nathan Nobbe
On Jan 18, 2008 12:04 PM, Carole E. Mah <[EMAIL PROTECTED]> wrote: > I did exactly this, and still got: > > > http://www.itunes.com/dtds/podcast-1.0.dtd"; version=" > 2.0"> > > > >My Title >My Link >

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-15 Thread Nathan Nobbe
On Jan 14, 2008 11:21 PM, Carole E. Mah <[EMAIL PROTECTED]> wrote: > Yes, I tried the following: > > http://us3.php.net/manual/en/function.dom-domdocument-createelementns.php > > Same results. > based upon information from bug #43221, if you define the namespace beforehand it will work. http://

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

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Nathan Nobbe
On Jan 14, 2008 10:22 PM, Carole E. Mah <[EMAIL PROTECTED]> wrote: > 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 >

[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