Login   Register  
PHP Classes

HTMLPP: Parse HTML code and manage the DOM structure

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Marco Marchiņ
Name: Marco Marchiņ <e-mail contact>
Packages: 3 Browse all classes by Marco Marchiņ Browse all classes by
Country: Italy Italy - PHP jobs in Italy
Age: 25
All time rank: 77831 in Italy Italy
Week rank: 513 Up21 in Italy Italy Up
Innovation award
Innovation award
Nominee: 2x

  Detailed description   Download Download .zip .tar.gz  
HTMLPP is a PHP4 library for HTML code parsing. It allows you to parse a HTML code string, build the relative DOM structure and work on it with methods similar to Javascript.


HTML parsing:
- Simple tags
- Tags without closures
- Autoclosing tags
- Doctype, text and comment parsing
- Modern browser parsing behaviour (Add head,body and html tags if they're not present, Wrap table content inside the tbody if it's not present)

Dom traversing:
- Access to the parent node using the parentNode property
- Access to child nodes using the childNodes array property
- Access to sibling nodes using nextSibling and previousSibling properties
- Access to the owner document with ownerDocument property
- Document shortcuts to body, head and doctype

Dom manipulation:
- Append nodes with appendChild, append and other methods
- Remove nodes with removeChild and remove methods
- Replace nodes with replaceChild and replace methods

Attributes and style manipulation:
- Add, remove, set and get methods for attributes
- Add, remove, set and get methods for style properties

Node searching functions on every element:
- getElementById
- getElementsByTagName
- getElementsByClassName
- getElementsBySelector (Full featured support for Css3 selectors, Support for other non-standard selectors)
- Node iterator class for personalized filter functions

Dom collections with JQuery like methods:
- Add, remove and filter elements in the collection
- Change the current collection by searching in its elements siblings, child nodes or parent nodes
- Manipulate elements in the collection


- first release
- Fixed some bugs in elements parsing regexp
- Fixed a bug in doctype parsing
- Fixed some problems in the parser class
- Fixed a bug in HTMLFilterIterator::find() function when pass HTML_SEARCH_DESCENDANT as iteration type
- Fixed error on selector parsing
- Now every element is closed at the end of its parent code if no closing tag is found
- Better support for textarea tag
- Fixed bug on attributes parsing (thanks Mike)
- Fixed bug in getAttribute() method
- Fixed bug in getStyle() method
- Fixed bug on attributes parsing

  Classes of Marco Marchiņ  >  HTMLPP  >  Download Download .zip .tar.gz  >  Support forum Support forum (4)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Base name: htmlpp
Description: Parse HTML code and manage the DOM structure
Version: 1.0.3
PHP version: 4.2
License: GNU Lesser General Public License (LGPL)
All time users: 671 users
All time rank: 4326
Week users: 3 users
Week rank: 821 Up
  Groups   Rate classes User ratings   Applications   Files Files  

Group folder image HTML HTML generation and processing View top rated classes

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Accessible without login HTML file documentation.html Doc. Documentation and examples
Plain text file HTMLCollection.php Class HTML collections class
Plain text file HTMLFilterIterator.php Class HTML filter iterator class
Plain text file HTMLNode.php Class HTML nodes class
Plain text file HTMLParser.php Class HTML parser private class
Plain text file HTMLPP.php Class Main HTMLPP class

Download Download all files: htmlpp.tar.gz htmlpp.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.