Home » XML » XML_Tree » Bug #1125
Empty tag like <br /> is not possible
Details
| Submitted | 2004-04-03 23:57 UTC |
|---|---|
| From | guillaume dot lecanu at online dot fr |
| Assigned | davey |
| Status | Closed |
| Package | XML_Tree |
| PHP Version | 4.3.4 |
| OS | Debian Sid |
| Roadmaps | (Not assigned) |
Comments
[2004-04-03 23:57 UTC] guillaume dot lecanu at online dot fr
Description:
------------
You cannot make empty tags like <br /> or <img />
The output return this : <br></br>
I have sent a mail on the ML for fix it.
Reproduce code:
---------------
// From the test.php example, i have add 2 lines for make an // "empty tag" 'br' and a standard tag 'span' with a empty value
$tree = new XML_Tree;
$root = $tree->addRoot('MyFriends');
$foo = $root->addChild('name', 'Foo');
$foo = $root->addChild('br');
$foo = $root->addChild('span', '');
$bar = $root->addChild('name', 'Bar', array('age' => 21));
$tree->dump();
Expected result:
----------------
<MyFriends>
<name>Foo</name>
<br></br>
<span></span>
<name age="21">Bar</name>
</MyFriends>
But the good result must be :
<MyFriends>
<name>Foo</name>
<br />
<span></span>
<name age="21">Bar</name>
</MyFriends>