Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
jlex
/
php4
/
Upload File :
New :
File
Dir
/home/cluster1/data/bu01/1121861/html/jlex/php4/project_defaults.php4
<? class project_defaults { var $parser; var $data; var $defaults; var $get_defaults = false; function project_defaults() { $this->data = ""; $this->defaults = array(); } function startHandler($xp, $element, $attribs) { $element = strtolower($element); if($element == "defaults") $this->get_defaults = true; } function endHandler($xp, $element) { $element = strtolower($element); if($element == "defaults") $this->get_defaults = false; if($this->get_defaults) $this->defaults[$element] = $this->data; $this->data = ""; } function cDataHandler($xp,$data) { $data = trim($data); if($data != "") { $data = ereg_replace("&","&",$data); $data = ereg_replace("<","<",$data); $data = ereg_replace(">",">",$data); $this->data .= $data; } } function get_project_defaults($xml) { $this->parser = xml_parser_create(); xml_set_object($this->parser,$this); xml_set_element_handler($this->parser,"startHandler","endHandler"); xml_set_character_data_handler($this->parser,"cDataHandler"); $in = fopen($xml,"r"); while($line = fgets($in)) { xml_parse($this->parser,$line,false); } return $this->defaults; } } ?>