PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jonas Eriksson  >  BowML  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Demo of what BowML can do.
Class: BowML
Parse and create HTML or other markup documents
Author: By
Last change:
Date: 11 years ago
Size: 1,766 bytes
 

Contents

Class file image Download
<?PHP
   
   
/* B o w M L - a l p h a
     * A test file for reading, parsing, manipulating and outputing HTML-files.
     * The example loads Google´s startpage and changes its title.
     * In this early alpga version of BowML: all JavaScripts are removed.
     *
     * // redRemedy. Oh yeah... this is GPL. Read more on http://bowml.sf.net
     *
     * PS. Look at the nice indentation of the new HTML-source code btw...
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

   
require_once("BowMathFunctions.inc.php");//Nothing impressive yet ;)
   
require_once("bowMessages.inc.php");//Useful for validatation
   
require_once("array_merge_deep.inc.php");//Soon to be changing the name of this one
   
require_once("character.inc.php");//Soon to be changed to ctype-functions
   
require_once("BowStream.inc.php");//Soon to be deprecated
   
require_once("BowList.inc.php");//Soon to be deprecated
   
require_once('BowHTMLCreation.inc.php');//Inludes the parser functionality
   
   
function getmicrotime()
    {
        list(
$usec, $sec) = explode(" ",microtime());
        return ((float)
$usec + (float)$sec);
    }
   
   
//Initializes the document
   
$tDocument =& new BowHTMLDocument();
   
   
//Parses the Google website
   
$tParser =& new BowHTMLParser('http://www.google.com/');
   
   
//changeTitleTo(...) is one of the many template methods (..several are planned)
   
$tParser->document->changeTitleTo("Lets change the title of Google with BowML! ;)");
               
   
$startTimeWrite = getmicrotime();
   
   
//Prints the reformated and manipulated document back to HTML
   
$tParser->document->toHTML();
   
    print(
"<b>Elapsed time writing: </b>".(getmicrotime() - $startTimeWrite).".<br>");

?>