/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/examples/example5.php
ViewVC logotype

Contents of /nfo/php/libs/com.newsblob.phphtmllib/examples/example5.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Thu May 6 16:27:17 2004 UTC (20 years, 2 months ago) by jonen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
 updated all to v2.4.1 - Apr 01, 2004

1 <?php
2
3 /**
4 * Another example of how to build an
5 * XML Document with the XML support
6 * that phpHtmlLib provides.
7 *
8 *
9 * $Id: example5.php,v 1.3 2003/02/27 22:07:57 hemna Exp $
10 *
11 * @author Walter A. Boring IV <waboring@buildabetterweb.com>
12 * @package phpHtmlLib
13 * @subpackage examples
14 * @version 2.0.0
15 *
16 */
17
18 /**
19 * Include the phphtmllib libraries
20 */
21 include_once("includes.inc");
22 include_once($phphtmllib."/widgets/xml/XMLDocumentClass.inc");
23
24 //build the xml document object with a
25 //root xml tag of <example5>, and a <!DOCTYPE>
26 //link attribute of "some doctype link"
27 $xmldoc = new XMLDocumentClass("example5", "http://foo.com/DTDS/mail.dtd");
28
29 //make sure we have the XMLDocumentClass automatically
30 //output the correct http Content-Type value
31 $xmldoc->show_http_header();
32
33 //add some tags to the root element
34 $xmldoc->add( xml_tag("testing", array(), "foo",
35 xml_tag("blah", array("value" => 1)) ) );
36
37 //build an array that represents
38 //xml tags and their values.
39 $arr = array("Foo" => array("bar" => "bleh",
40 "bar" => array("testing" => "php")));
41 //add those tags from the array
42 $xmldoc->add( array_to_xml_tree( $arr ) );
43
44 //this will render the entire page
45 print $xmldoc->render();
46 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed