#43514 [Opn->Bgs]: writelement warning
| From: | rrichards@php.net | Date: | Thu, 06 Dec 2007 12:28:57 +0000 |
| Subject: | #43514 [Opn->Bgs]: writelement warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-120419@lists.php.net to get a copy of this message | ||
ID: 43514
Updated by: rrichards@php.net
Reported By: stem at chalmers dot se
-Status: Open
+Status: Bogus
Bug Type: XML Writer
Operating System: Vista 32
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
If you actually looked at the notices being generated you would see
your script is buggy and you are passing bad values to writeElement
Previous Comments:
------------------------------------------------------------------------
[2007-12-06 10:22:13] stem at chalmers dot se
Description:
------------
issues a warning when passing an array value as "The element name"
Reproduce code:
---------------
<?php
$test = array('foo','bar');
$testarr = array('foo' =>
array('1','2','3'),'bar' =>
array('1','2','3'));
$titles = array('item_1', 'item_2');
header('Content-Type: text/xml; charset=iso-8859-1');
$xml = new xmlWriter();
$xml->openMemory();
$xml->setindent(true);
$xml->setindentstring(' ');
$xml->startDocument('1.0','iso-8859-1');
$xml->startElement ('root');
for($i=0;$i<count($test);$i++) {
$xml->writeElement ('title', $test[$i]);
$xml->startElement ('data');
for($j=0;$j<count($testarr[$test[$i]]);$j++) {
$xml->writeElement ($titles[$j], 'test');
}
$xml->endElement();
}
$xml->endElement();
print $xml->outputMemory(true);
?>
Expected result:
----------------
No warning.
Actual result:
--------------
<b>Warning</b>: XMLWriter::writeElement() [<a
href='function.XMLWriter-writeElement'>function.XMLWriter-writeElement</a>]:
Invalid Element Name in <b>D:\devel\bug\index.php</b> on line <b>18</b>
However the xmldata is printed correctley if the source is checked.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43514&edit=1