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
>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
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
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
4 matches
Mail list logo