PHP Classes
elePHPant
Icontem

HTML Manipulation like jQuery: Manipulate HTML documents using CSS selectors

Recommend this page to a friend!
  Info   View files View files (24)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-02-07 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 413 All time: 6,124 This week: 874Up
Version License PHP version Categories
domfss 1.0Public Domain5.3HTML, PHP 5
Description Author

This package can manipulate HTML documents using CSS selectors.

It can load HTML documents as a DOM node structure and use CSS selectors to find document elements.

Picture of Mohamad Mohebifar
Name: Mohamad Mohebifar <contact>
Classes: 1 package by
Country: Iran Iran

Details
Consider Example1.php
The HTML content is :
__________________________________

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">

<html>
    <head>
        <meta name="generator" content="FSS DOM Object">

        <title>My Test</title>
    </head>
    <body>
        <div id="biography">
            Hello ! I am Mohamad Mohebifar from iran and i was born in 1993.
            I study Chemistry & IT at Shahid Beheshti University.
        </div>
        <p>
            I present this class to FSS ! ?
        </p>
        <div class="myframework">
            Test
        </div>
    </body>
</html>

__________________________________
but with DOM object we made some changes and now the result is :
__________________________________

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta name="generator" content="FSS DOM Object">
<title>My Test</title>
</head>
<body>
        <div id="biography" title="My Auto Biography" style="background: yellow;">
            Hello ! I am Mohamad Mohebifar from iran and i was born in 1993.
            I study Chemistry & IT at Shahid Beheshti University.
        </div>
        <p class="myPrivacy">
            I present this class to FSS ! ♥
        You know !</p>
        <div class="myframework">
            Test
        <br>this is appended from a cloned node : 
            Hello ! I am Mohamad Mohebifar from iran and i was born in 1993.
            I study Chemistry & IT at Shahid Beheshti University.
        </div>
    </body>
</html>


__________________________________
with this code we make document from html string content :
pQuery::createDocFromHTML($html);

and now we select an element using CSS Selector
pQuery::select("p")

then we can do somework with it !! like jQuery
->addClass('myPrivacy')->append("You know !")

as you see in the result content, we have :
<p class="myPrivacy">
	FSS stands for my love's name. I present this class to FSS ! ♥
	You know !</p>
		
while the source was :
<p>
    FSS stands for my love's name. I present this class to FSS ! ?
</p>


now we can add css style, append some text, prepend text, set attribute, get attribue, clone, get inner html, set inner html, add or remove class, check existing class and destroy node !
PHPDoc is prepared for you. just use a good IDE that supports PHPDoc.
  Files folder image Files  
File Role Description
Files folder imageCssSelector (6 files, 2 directories)
Files folder imageDOM (2 files)
Image file coding_sample.jpg Screen sample of codes
Image file Example1.jpg Screen Screenshot from before and after effects of this class on example1
Plain text file example1.php Example Example with ready html
Plain text file example2_stack.php Example Example with not ready html
Plain text file Readme.txt Doc. How to use
Plain text file spl.php Aux. Spl

  Files folder image Files  /  CssSelector  
File Role Description
Files folder imageException (1 file)
Files folder imageNode (9 files)
  Plain text file CssSelector.php Class CssSelector
  Plain text file Token.php Class Token
  Plain text file Tokenizer.php Class Tokenizer
  Plain text file TokenStream.php Class TokenStream
  Plain text file XPathExpr.php Class XPathExpr
  Plain text file XPathExprOr.php Class XPathExprOr

  Files folder image Files  /  CssSelector  /  Exception  
File Role Description
  Plain text file ParseException.php Appl. ParseException

  Files folder image Files  /  CssSelector  /  Node  
File Role Description
  Plain text file AttribNode.php Class AttribNode
  Plain text file ClassNode.php Appl. ClassNode
  Plain text file CombinedSelectorNode.php Appl. CombinedSelectorNode
  Plain text file ElementNode.php Appl. ElementNode
  Plain text file FunctionNode.php Appl. FunctionNode
  Plain text file HashNode.php Appl. HashNode
  Plain text file NodeInterface.php Appl. NodeInterface
  Plain text file OrNode.php Appl. OrNode
  Plain text file PseudoNode.php Appl. PseudoNode

  Files folder image Files  /  DOM  
File Role Description
  Plain text file DOM.php Class Dom Main Class
  Plain text file DOMOperation.php Class Dom Operation

 Version Control Unique User Downloads Download Rankings  
 0%
Total:413
This week:0
All time:6,124
This week:874Up