createChild('a'); $ac->attribute('href', $href); $afontel =& $ac->createChild('font'); $afontel->attribute('color', '#eeeeee'); $afontel->text($name); $parent->text(' '); return; } $t1NumRows = 3; $t1NumCols = 3; $t2NumRows = 2; $t2NumCols = 2; $htmlDoc = new MiniXMLDoc(); $docRoot =& $htmlDoc->getRoot(); $html =& $docRoot->createChild('html'); $head =& $html->createChild('head'); $title =& $head->createChild('title', 'MiniXML Generated HTML page'); $style =& $head->createChild('style'); $style->comment("body,td,a,p,.h{font-family:arial,sans-serif;} .q{text-decoration:none; color:#0000cc;}"); $body =& $html->createChild('body'); $body->attribute('bgcolor', '#ffffff'); $body->attribute('link', '#0000cc'); $body->attribute('vlink', '#551a8b'); $h =& $body->createChild('h3', 'This page was generated by MiniXML!'); /* Note that, when MINIXML_AUTOESCAPE_ENTITIES is set, we can stick in <> tags */ $p1 =& $body->createChild('p', "It slices, dices and never forgets the ! heh ;) "); $br =& $p1->createChild('br'); $p1->text("View the source of this page to take a look at "); $href =& $p1->createChild('a'); $href->attribute('href', 'http://minixml.psychogenic.com'); $href->text('MiniXML'); $p1->text("'s clean HTML."); $p1->createChild('br'); $p1->text("You can also take a look at the "); $href2 =& $p1->createChild('a', 'php source'); $href2->attribute('href', 'genhtml.php.txt'); $p1->text("that created this page."); $p2 =& $body->createChild('p'); $font =& $p2->createChild('font'); $font->attribute('size', '-1'); $font->attribute('color', '#3333cc'); $font->text('The table below was generated with php - hooray.'); $p =& $body->createChild('p'); $p->attribute('align', 'center'); $t1 =& $p->createChild('table'); $t1->attribute('cellpadding', 5); for ($i=0; $i < $t1NumRows; $i++) { $tr =& $t1->createChild('tr'); for ($j=0; $j < $t1NumCols; $j++) { $td =& $tr->createChild('td'); $td->attribute('bgcolor', '#542565'); $ntable =& $td->createChild('table'); for ($k = 0; $k < $t2NumRows; $k++) { $ntr =& $ntable->createChild('tr'); for ($l=0; $l < $t2NumCols; $l++) { $ntd =& $ntr->createChild('td'); $ntd->attribute('bgcolor', '#401151'); $nfont =& $ntd->createChild('font'); $nfont->attribute('color', '#eeeeee'); $nfont->attribute('size', '-2'); $nfont->text("This is cell "); $nfont->createChild('br'); $nfont->text("($i,$j,$k,$l)"); } } } } $tr =& $t1->createChild('tr'); $td =& $tr->createChild('td'); $td->attribute('colspan', $t1NumCols); $td->attribute('bgcolor', '#542565'); $td->attribute('align','center'); $font =& $td->createChild('font'); $font->attribute('size', '-2'); $font->attribute('color', '#eeeeee'); $font->text('Table brought to you by '); createHREF($font, 'PHP', 'http://www.php.net'); createHREF($font,'MiniXML','http://minixml.psychogenic.com'); createHREF($font,'psychogenic','http://www.psychogenic.com'); $font->text('and a bunch of nested loops'); $lastP =& $body->createChild('p'); $lastP->attribute('align', 'left'); $lastP->text("============================"); $lastP->createChild('br'); $endtable =& $lastP->createChild('table'); $endtable->attribute('width', '75%'); $endtable->attribute('align', 'center'); $etr = & $endtable->createChild('tr'); $etd =& $etr->createChild('td'); $etd->createChild('b', "And here is the output of \$htmlDoc->getValue()"); $etd->createChild('br'); $etd->text($htmlDoc->getValue()); print $htmlDoc->toString(); ?>