XhtmlParser

Help

XhtmlParser Manual

Users

Download XhtmlParser files

Project detail and discuss

Get support

Not what you're looking for?

SourceForge.net hosts over 100,000 Open Source projects. You may find what you're looking for by searching our site or using our Software Map.

Developers

Join this project:

To join this project, please contact the project administrators of this project, as shown on the project summary page.

Get the source code:

Source code for this project may be available as downloads or through the CVS or Subversion SCM repository used by the project, as accessible from the project summary page.

Update project web pages:

This page is the default project web page supplied by SourceForge.net. If you are a member of this project, you can deploy your own project web pages as per our site documentation.

If you are a web page developer interested in this project, please consider reaching out to the project admin (per the "Join this project" section, above) to offer your assistance.

About SourceForge.net:

SourceForge.net is the world's largest provider of hosting for Open Source software development projects. SourceForge.net provides a variety of services to projects, including a download mirror network, collaborative development tools (like CVS and Subversion), and tools to support discussion and support. These services are provided to projects and their end-users free-of-charge.

About Open Source:

Of benefit to users, Open Source software is licensed so you can download and use the software free-of-charge. The source code for this software is made available free-of-charge, you (or a programmer you hire) can make changes to this software to better meet your needs, and you can release your changed code back to the community passing the benefit on to other users.

The exact license terms used by this project on their project summary page and in the licensing documents included in their downloads.

This is the XhtmlParser project ("xhtmlparser")

This project was registered on SourceForge.net on Feb 2, 2009, and is described by the project team as follows:

XhtmlParser is a simple HTML/XHTML parser written in PHP5 object oriented.
XHtmlParser allows you to iterate/modify XHTML nodes and get/set their attributes.
It parse XHTML data to build object structure.

The parser read data just one time, so there is a very limited HTML syntax error tolerance.

Here is a short sample code :

 1: <?php
 2: 
 3: include('XhtmlDocument.class.php');
 4: 
 5: $html = file_get_contents($_REQUEST['url']);
 6: $doc = new XhtmlDocument($html);
 7: 
 8: // select some node
 9: //$element = $doc->xpath('html/head/meta[2]');
10: //$element = $doc->xpath('div[id=content]/h2');
11: $element = $doc->xpath('html/head');
12: 
13: //echo $element->toHtml();
14: echo '<pre>'.$element->dump().'</pre>';
15: 
16: 
17: /*
18:  *
19:  * using dump(), you should see something like this : 
20: 
21: <meta>
22:   http-equiv="content-type"
23:   content="text/html; charset=ISO-8859-1"
24: <title>
25:   Google
26: 
27:  * 
28:  */
29: 

For more informations, see the manual here : XhtmlParser Manual (see XhtmlDocument and XhtmlEntity classes)

Project Web Hosted by SourceForge.net

©Copyright 1999-2008 - SourceForge, Inc., All Rights Reserved

About - Legal - Help