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

From: Date: Mon, 07 Mar 2011 12:32:33 +0000
Subject: note 102795 modified in function.xmlwriter-start-element-ns by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177613@lists.php.net to get a copy of this message
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

« previous php.notes (#177613) next »