81 $this->success =
true;
85 $f_in = fopen(
$path,
"r");
87 $this->success =
false;
91 $xml_parser = xml_parser_create_ns(
"UTF-8",
" ");
93 xml_set_element_handler($xml_parser, array(&$this,
98 xml_set_character_data_handler($xml_parser, array(&$this,
102 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
104 while ($this->success && !feof($f_in)) {
105 $line = fgets($f_in);
106 if (is_string($line)) {
108 $this->success&= xml_parse($xml_parser, $line,
false);
113 $this->success&= xml_parse($xml_parser,
"",
true);
116 $this->success&= !empty($this->locktype);
117 $this->success&= !empty($this->lockscope);
119 xml_parser_free($xml_parser);
135 if (strstr($name,
" ")) {
136 list($ns, $tag) = explode(
" ", $name);
142 if ($this->collect_owner) {
150 $ns_attr =
" xmlns='$ns'";
153 $this->owner.=
"<$ns_short$tag$ns_attr>";
154 }
else if ($ns ==
"DAV:") {
158 $this->locktype = $tag;
163 $this->lockscope = $tag;
167 $this->collect_owner =
true;
183 if ($this->collect_owner) {
184 $this->owner.=
$data;
198 if (strstr($name,
" ")) {
199 list($ns, $tag) = explode(
" ", $name);
205 if (($ns ==
"DAV:") && ($tag ==
"owner")) {
206 $this->collect_owner =
false;
209 if ($this->collect_owner) {
216 $ns_attr =
" xmlns='$ns'";
219 $this->owner.=
"</$ns_short$tag$ns_attr>";
_endElement($parser, $name)
_startElement($parser, $name, $attrs)