82 $this->success =
true;
86 $f_in = fopen(
$path,
"r");
88 $this->success =
false;
92 $xml_parser = xml_parser_create_ns(
"UTF-8",
" ");
94 xml_set_element_handler($xml_parser, array(&$this,
99 xml_set_character_data_handler($xml_parser, array(&$this,
103 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
105 while ($this->success && !feof($f_in)) {
106 $line = fgets($f_in);
107 if (is_string(
$line)) {
109 $this->success&= xml_parse($xml_parser,
$line,
false);
114 $this->success&= xml_parse($xml_parser,
"",
true);
117 $this->success&= !empty($this->locktype);
118 $this->success&= !empty($this->lockscope);
120 xml_parser_free($xml_parser);
136 if (strstr(
$name,
" ")) {
137 list($ns, $tag) = explode(
" ",
$name);
143 if ($this->collect_owner) {
151 $ns_attr =
" xmlns='$ns'";
154 $this->owner.=
"<$ns_short$tag$ns_attr>";
155 }
else if ($ns ==
"DAV:") {
159 $this->locktype = $tag;
164 $this->lockscope = $tag;
168 $this->collect_owner =
true;
184 if ($this->collect_owner) {
185 $this->owner.= $data;
199 if (strstr(
$name,
" ")) {
200 list($ns, $tag) = explode(
" ",
$name);
206 if (($ns ==
"DAV:") && ($tag ==
"owner")) {
207 $this->collect_owner =
false;
210 if ($this->collect_owner) {
217 $ns_attr =
" xmlns='$ns'";
220 $this->owner.=
"</$ns_short$tag$ns_attr>";