PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_Tree » Bug #4996

Adding support for switching off short tags

Details

Request #4996Adding support for switching off short tags
Submitted2005-08-04 08:51 UTC
Fromfelash at gmail dot com
StatusSuspended
PackageXML_Tree
PHP Version4.3.11
OSIrrelevant
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) {