note 102795 modified in function.xmlwriter-start-element-ns by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
by default, the xmlns: definition is repeated on every element.

if you do want the prefix, but dont want the xmlns: declaration repeated, set the namespace to null. dont forget to declare the namespace prefix somewhere higher in your document, though:

<?php
$w->startElementNS('foo', 'bar', 'http://example.com/foo');
$w->startElementNS('foo', 'baz', null);
$w->endElement();
$w->endElement();
?>

--was--
by default, the xmlns: definition is repeated on every element.

if you do want the prefix, but dont want the xmlns: declaration repeated, set the namespace to null. dont forget to declare the namespace prefix somewhere higher in your document, though:

$w->startElementNS('foo', 'bar', 'http://whatever/foo');
$w->startElementNS('foo', 'baz', null);
$w->endElement();
$w->endElement();

http://php.net/manual/en/function.xmlwriter-start-element-ns.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.