$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();
<?php /** ensure this file is being included by a parent file */ defined('_JEXEC') or die('Restricted access'); require_once './minixml.inc.php'; $t1NumRows = 3; $t1NumCols = 3; $t2NumRows = 2; $t2NumCols = 2; $htmlDoc = new MiniXMLDoc(); $htmlArray = array('html' => array('head' => array('title' => 'XML::Mini Generated HTML page', 'style' => 'body,td,a,p,.harray(font-family:arial,sans-serif;) .qarray(text-decoration:none; color:#0000cc;)'), 'body' => array('bgcolor' => '#ffffff', 'link' => '#0000cc', 'vlink' => '#551a8b', 'h3' => 'This page was generated by XML::Mini!', 'p' => array(array('-content' => 'View the source of this page to take a look at', 'a' => array('href' => 'http://minixml.psychogenic.com', '-content' => 'XML::Mini')), array('font' => array('size' => '-1', 'color' => '#3333cc', '-content' => 'The table below was generated with php - hooray.')), array('align' => 'center', 'table' => array('cellpadding' => 5)), array('align' => 'left', '-content' => '============================', 'table' => array('width' => '75%', 'align' => 'center', 'tr' => array(array('td' => array('b' => "And here is the output of \$htmlDoc->getValue()", 'br' => '', '-content' => $htmlDoc->getValue()))))))))); # end of hash $options = array('attributes' => array('body' => array('bgcolor', 'link', 'vlink'), '-all' => array('align', 'color'), 'a' => 'href', 'font' => 'size', 'table' => array('cellpadding', 'cellspacing'))); $htmlDoc->fromArray($htmlArray, $options); print $htmlDoc->toString();
<div ALIGN="CENTER"><B>MiniXML output</B></div><CODE> <?php /* We create a new MiniXMLDoc object */ $returnedXMLDoc = new MiniXMLDoc(); /* And parse the returned string (assume it was stored in ** $xmlString */ $returnedXMLDoc->fromString($xmlString); /* Now to verify that the document has been initialised from ** the string, we use toString() to output an XML document. */ print "Call to : \$returnedXMLDoc-><font color=\"ee3333\">toString</font>() returns:\n"; print htmlentities($returnedXMLDoc->toString()); print "Call to : \$returnedXMLDoc-><font color=\"ee3333\">getValue</font>() returns:"; print "\n\n</CODE></PRE><FONT SIZE=\"-2\">" . $returnedXMLDoc->getValue() . "</FONT><PRE><CODE>"; /* We can now query the document, fetching elements by name ** (and path) or as a list of children. ** ** Let's start by fetching the partsRateReply element. ** Normally, you'd be verifying that the element was found ** but in order to keep this light and keep everybody from ** getting into the habit of good error checking, I'll skip ** it. ** ** getElement() returns the first element with a matching name. ** if there are multiple elements with the same name, use one ** of the methods below. */ /* Note: the '=&' operator here is optional: since we won't ** be modifying the response it doesn't matter if we work on