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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Sat Sep 20 00:20:55 2003 UTC (20 years, 10 months ago) by jonen
Branch: MAIN
Changes since 1.2: +2 -1 lines
+ updated whole phphtmllib to v2.3.0

1 jonen 1.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 jonen 1.3 * $Id: example5.php,v 1.3 2003/02/27 22:07:57 hemna Exp $
10 jonen 1.1 *
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 jonen 1.3 include_once($phphtmllib."/widgets/xml/XMLDocumentClass.inc");
23 jonen 1.1
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