81 $this->success =
true;
87 $f_in = fopen(
$path,
"r");
89 $this->success =
false;
94 $xml_parser = xml_parser_create_ns(
"UTF-8",
" ");
97 xml_set_element_handler($xml_parser,
98 array(&$this,
"_startElement"),
99 array(&$this,
"_endElement"));
100 xml_set_character_data_handler($xml_parser,
101 array(&$this,
"_data"));
104 xml_parser_set_option($xml_parser,
105 XML_OPTION_CASE_FOLDING,
false);
108 while($this->success && !feof($f_in)) {
109 $line = fgets($f_in);
110 if (is_string($line)) {
112 $this->success &= xml_parse($xml_parser, $line,
false);
118 $this->success &= xml_parse($xml_parser,
"",
true);
122 $this->success &= !empty($this->locktype);
123 $this->success &= !empty($this->lockscope);
126 xml_parser_free($xml_parser);
145 if (strstr($name,
" ")) {
146 list($ns, $tag) = explode(
" ", $name);
153 if ($this->collect_owner) {
161 $ns_attr =
" xmlns='$ns'";
164 $this->owner .=
"<$ns_short$tag$ns_attr>";
165 }
else if ($ns ==
"DAV:") {
169 $this->locktype = $tag;
173 $this->lockscope = $tag;
176 $this->collect_owner =
true;
193 if ($this->collect_owner) {
194 $this->owner .=
$data;
209 if (strstr($name,
" ")) {
210 list($ns, $tag) = explode(
" ", $name);
217 if (($ns ==
"DAV:") && ($tag ==
"owner")) {
218 $this->collect_owner =
false;
222 if ($this->collect_owner) {
229 $ns_attr =
" xmlns='$ns'";
232 $this->owner .=
"</$ns_short$tag$ns_attr>";