PHP Classes

XML to HTML menu: Generate menus in XML and HTML

Recommend this page to a friend!
  Info   View files View files (16)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 38%Total: 1,903 All time: 2,072 This week: 488Up
Version License Categories
xmltohtmlmenu 1.0Free for non-comm...HTML, XML, PHP 5


This package can be used to generate menus in XML and HTML.

It can add items to the menu definition. Each item can have associated and other attributes.

From the menu definition it can generate a XML document that describes the menus. The menu XML definition documents can also be generated manually or by some other process.

The HTML menus are generated by transforming the menu XML documents into HTML using XSL style sheets.

Picture of Johan Barbier
Name: Johan Barbier <contact>
Classes: 17 packages by
Country: France France
Age: 52
All time rank: 402 in France France
Week rank: 354 Down11 in France France Down
Innovation award
Innovation award
Nominee: 6x


XMLMENU [PHP5] DOMDocument and XSLTProcessor enabled are best, but not mandatory. Called this way : $menu = xmlmenu::getInstance (optional (string) sVersion, optional (string) sEncoding); see index.php for more information, and comments in classes. DESCRIPTION This package is meant to : - generate an XML menu - generate an HTML menu using the generated XML xmlmenu::getInstance () determines which extensions are or are not enabled, and instanciates the correct class. First step : - generate the XML. Can be done with the class, or manually (the xml files are stored in 'xml/'. They look like : <menu><node>text1<node>text1_2</node></node><node>text2</node></menu> 3 methods : xmlmenu::defineNode () to define a new node xmlmenu::defineAttributes () to define attributes for a given node (can be done directly with xmlmenu::defineNode()) xmlmenu::defineLink () to define the href link of the node Notice : the node are attributed an id via xml:id. - see the generated xml via echo $menu (xmlmenu::__toString() method) - save the xml file if needed via xmlmenu::xmlToFile() - load an xml from a file via xmlmenu::fileToXml() - apply an XSL to the menu to generate an HTML menu via xmlmenu::toHTML() The xsl needs to be created first, of course. I have created 2, they are stored in 'xsl/'. - save an html menu via xmlmenu::htmlToFile()

  Files folder image Files  
File Role Description
Files folder imageclass (5 files)
Files folder imagehtml (3 files)
Files folder imagetmp_xml (1 file)
Files folder imagexml (3 files)
Files folder imagexsl (2 files)
Accessible without login Plain text file index.php Example index pge
Plain text file readme.txt Doc. documentation

  Files folder image Files  /  class  
File Role Description
  Accessible without login Plain text file abstractxmlmenu.cls.php Class abstract xml menu class
  Accessible without login Plain text file xmlmenu.cls.php Class xmlmenu factory class
  Accessible without login Plain text file xmlmenuhasboth.cls.php Class xmlmenu class when DOMDocument and XSLTProcessor are enabled
  Accessible without login Plain text file xmlmenuhasdom.cls.php Class xml menu class when only DOMDocument is enabled
  Accessible without login Plain text file xmlmenuhasnone.cls.php Class xml menu class when no extension are enabled

  Files folder image Files  /  html  
File Role Description
  HTML file menu1.html Output html menu example
  HTML file menu2.html Output html menu example
  HTML file menu3.html Output html menu example

  Files folder image Files  /  tmp_xml  
File Role Description
  Plain text file tmp_xmllfile_2.xml Output temp xml file example

  Files folder image Files  /  xml  
File Role Description
  Plain text file menu1.xml Output menu xml example
  Plain text file menu2.xml Output xml menu example
  Plain text file menu3.xml Output xml menu example

  Files folder image Files  /  xsl  
File Role Description
  Plain text file liste.xsl Data list xsl file
  Plain text file table.xsl Data table xsl file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:2,072
This week:488Up
 User Ratings  
 All time