Home » XML » XML_Tree » Bug #4996
Adding support for switching off short tags
Details
| Request #4996 | Adding support for switching off short tags |
|---|---|
| Submitted | 2005-08-04 08:51 UTC |
| From | felash at gmail dot com |
| Status | Suspended |
| Package | XML_Tree |
| PHP Version | 4.3.11 |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-08-04 08:51 UTC] felash at gmail dot com
Description:
------------
Hi,
I'm using the last version of XML_Tree (2.0.0RC2), and I would like to be able to turn off the "short tags" feature for empty elements (to have <a></a> instead of <a />).
It's actually needed if you want to generate HTML instead of pure XML, since "<a />" tags aren't correctly parsed with most browsers, especially with css.
Test script:
---------------
I don't have an actual diff, but the change is easy; in XML/Tree/Node.php :
line 294 :
- function &get($use_cdata_section = false)
+ function &get($use_cdata_section = false, $short_tags = false)
line 321 :
- if ($this->content == '' && sizeof($this->children) === 0 && $deep != 0) {
+ if ($this->content == '' && sizeof($this->children) === 0 && $deep != 0 && $short_tags) {