PageRenderTime 54ms CodeModel.GetById 47ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/class/class.xmlcreator.php

http://freshdns.googlecode.com/
PHP | 48 lines | 37 code | 8 blank | 3 comment | 2 complexity | a110f117f785293ec477da2718259079 MD5 | raw file
 1<?
 2class xmlcreator {
 3	var $content;
 4
 5	function __construct ()
 6	{
 7		$this->content = "";
 8	}
 9	
10	function __destruct ()
11	{
12		unset($this->content);
13	}
14	
15	function addHeader()
16	{
17		//header('Content-Type: application/xml');
18		$this->content .= "<?xml version=\"1.0\"?>\n";
19	}
20	
21	function addTag ($tagName, $tagLevel)
22	{
23		// ADD THE TABS
24		for($i=0; $i<$tagLevel; $i++)
25		{
26			$this->content .= "\t";
27		}
28		
29		$this->content .= "<".$tagName.">\n";
30	}
31	
32	function addItem ($tagName, $tagContent, $tagLevel)
33	{
34		// ADD THE TABS
35		for($i=0; $i<$tagLevel; $i++)
36		{
37			$this->content .= "\t";
38		}
39		
40		$this->content .= "<".$tagName.">".$tagContent."</".$tagName.">\n";
41	}
42	
43	function returnContent ()
44	{
45		return $this->content;
46	}
47}
48?>