note 103498 deleted from function.xmlwriter-write-attribute by cmb

From: Date: Sun, 20 Sep 2020 15:43:17 +0000
Subject: note 103498 deleted from function.xmlwriter-write-attribute by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-215162@lists.php.net to get a copy of this message
Note Submitter: Jason Hughes ---- If you intermix writing sub-elements and attributes, any attributes that are written after the first sub-element are ignored/discarded: <?php $xml->startElement('element'); $xml->writeAttribute('attr1', 0); $xml->writeElement('subelem', 0); $xml->writeAttribute('attr2', 0); $xml->endElement(); ?> Outputs: <element attr1=0> <subelem>0</subelem> </element> This is stupid, but the way it works as of PHP 5.2.4.

« previous php.notes (#215162) next »