67 $this->success =
true;
69 $this->props = array();
75 $f_in = fopen(
$path,
"r");
77 $this->success =
false;
81 $xml_parser = xml_parser_create_ns(
"UTF-8",
" ");
83 xml_set_element_handler($xml_parser, array(&$this,
89 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
91 while ($this->success && !feof($f_in)) {
93 if (is_string(
$line)) {
95 $this->success&= xml_parse($xml_parser,
$line,
false);
100 $this->success&= xml_parse($xml_parser,
"",
true);
103 xml_parser_free($xml_parser);
107 if (!count($this->props)) $this->props =
"all";
121 if (strstr(
$name,
" ")) {
122 list($ns, $tag) = explode(
" ",
$name);
123 if ($ns ==
"") $this->success =
false;
129 if ($this->depth == 1) {
130 if ($tag ==
"allprop") $this->props =
"all";
132 if ($tag ==
"propname") $this->props =
"names";
135 if ($this->depth == 2) {
139 if ($ns) $prop[
"xmlns"] = $ns;
140 $this->props[] = $prop;