note 103498 added to function.xmlwriter-write-attribute

From: Date: Fri, 15 Apr 2011 20:37:53 +0000
Subject: note 103498 added to function.xmlwriter-write-attribute
Groups: php.notes 
Request: Send a blank email to php-notes+get-178902@lists.php.net to get a copy of this message
If you intermix writing sub-elements and attributes, any attributes that are written after the first sub-element are ignored/discarded: $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. ---- Server IP: 69.147.83.197 Probable Submitter: 99.47.176.189 ---- Manual Page -- http://www.php.net/manual/en/function.xmlwriter-write-attribute.php Edit -- https://master.php.net/note/edit/103498 Del: integrated -- https://master.php.net/note/delete/103498/integrated Del: useless -- https://master.php.net/note/delete/103498/useless Del: bad code -- https://master.php.net/note/delete/103498/bad+code Del: spam -- https://master.php.net/note/delete/103498/spam Del: non-english -- https://master.php.net/note/delete/103498/non-english Del: in docs -- https://master.php.net/note/delete/103498/in+docs Del: other reasons-- https://master.php.net/note/delete/103498 Reject -- https://master.php.net/note/reject/103498 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#178902) next »