Bug #68756 [NEW]: attributes added after subelements are ignored

From: Date: Tue, 06 Jan 2015 00:58:29 +0000
Subject: Bug #68756 [NEW]: attributes added after subelements are ignored
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189673@lists.php.net to get a copy of this message
From:             bas5winkel at gmail dot com
Operating system: all?
PHP version:      5.5.20
Package:          XML Writer
Bug Type:         Bug
Bug description:attributes added after subelements are ignored

Description:
------------
---
From manual page: http://www.php.net/function.xmlwriter-write-attribute
---

If you intermix writing sub-elements and attributes, any attributes that
are written after the first sub-element are ignored/discarded.


Test script:
---------------
<?php
$xml->startElement('element');
  $xml->writeAttribute('attr1', 0);
  $xml->writeElement('subelem', 0);
  $xml->writeAttribute('attr2', 0);
$xml->endElement();
?>


Expected result:
----------------
<element attr1=0 attr2=0>
  <subelem>0</subelem>
</element> 

Actual result:
--------------
<element attr1=0>
  <subelem>0</subelem>
</element> 

-- 
Edit bug report at https://bugs.php.net/bug.php?id=68756&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=68756&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=68756&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=68756&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=68756&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=68756&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=68756&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=68756&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=68756&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=68756&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=68756&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=68756&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=68756&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=68756&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68756&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=68756&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=68756&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=68756&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68756&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=68756&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=68756&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#189673) next »