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 » HTML » HTML_TreeMenu » Bug #8757

No node created using xml from file

Details

Submitted2006-09-21 13:24 UTC
FromAnthonyM at leech dot co dot uk
Assignedcweiske
StatusWont fix
PackageHTML_TreeMenu
PHP Version5.1.6
OSLinux (Gentoo)
Roadmaps(Not assigned)

Comments

[2006-09-21 13:24 UTC] AnthonyM at leech dot co dot uk

Description:
------------
Using Tree-1.0.3, and the code below, and the xml file below. I get no nodes created.

Using the "simple script" with hard-coded values works as it should.

What am I doing wrong?

Test script:
---------------
PHP Code
<?php
require_once('HTML/TreeMenu.php');
require_once('Tree.php');

// Load the XML file
$xml = file_get_contents('menu.xml');

$menu = new HTML_TreeMenu();
$menu->createFromXML($xml);

// Choose a generator. You can generate DHTML or a Listbox
//$tree = new HTML_TreeMenu_Listbox($menu);
$tree = new HTML_TreeMenu_DHTML($menu);

echo $tree->toHTML();

?>

menu.xml

<treemenu>
<node text="First node" icon="folder.gif" expandedIcon="folder-expanded.gif" />
<node text="Second node" icon="folder.gif" expandedIcon="folder-expanded.gif">
<node text="Sub node" icon="folder.gif" expandedIcon="folder-expanded.gif" />
</node>
<node text="Third node" icon="folder.gif" expandedIcon="folder-expanded.gif">
</treemenu>