PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_Tree » Bug #1534

With new short tags, you doesn't change the line

Details

Submitted2004-06-01 22:09 UTC
Fromdamien dot cassou at laposte dot net
StatusWont fix
PackageXML_Tree
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-06-01 22:09 UTC] damien dot cassou at laposte dot net

Description:
------------
You forgot to change the line after a short tag :

--- Node.php.bak 2004-06-01 23:56:35.000000000 +0200
+++ Node.php 2004-06-02 00:13:42.000000000 +0200
@@ -314,7 +314,7 @@
}

if ($this->content == '' && sizeof($this->children) === 0 && $deep != 0) {
- $out .= ' />';
+ $out .= " />\n";
$empty = true;
} else {
$out .= '>';

[2004-06-01 22:18 UTC] damien dot cassou at laposte dot net

Example :
<?php

require_once("XML/Tree.php");

$tree =& new XML_Tree;
$root =& $tree->addRoot("root");

$node =& $root->addChild("child1");
$node =& $root->addChild("child2");

echo $tree->get();

?>

Results :
<?xml version="1.0"?>
<root>
<child1 /> <child2 /></root>

Exepected :
<?xml version="1.0"?>
<root>
<child1 />
<child2 />
</root>

[2004-06-02 07:43 UTC] damien dot cassou at laposte dot net

You can look at the exemple. Do you think the indentation is correct ? I don't think so. I prefer to see tags aligned instead of all in a same line with lot of spaces between them.

[2004-06-02 08:20 UTC] damien dot cassou at laposte dot net

I don't think the standards tell where to put blank lines and spaces. But the fonction print spaces before tags and line break after close tags. I don't understand why you don't want to go on correctly indenting the XML produced. It's so easy and you have done all the work.
I want to use this package for producing XHTML documents. I think a good indentation in the sources can help the debug.