80 $this->success =
true;
83 $this->props =
array();
86 $f_in = fopen(
$path,
"r");
88 $this->success =
false;
92 $xml_parser = xml_parser_create_ns(
"UTF-8",
" ");
94 xml_set_element_handler(
96 array(&$this,
"_startElement"),
97 array(&$this,
"_endElement")
100 xml_set_character_data_handler(
102 array(&$this,
"_data")
105 xml_parser_set_option(
107 XML_OPTION_CASE_FOLDING,
111 while ($this->success && !feof($f_in)) {
112 $line = fgets($f_in);
113 if (is_string($line)) {
115 $this->success &= xml_parse($xml_parser, $line,
false);
120 $this->success &= xml_parse($xml_parser,
"",
true);
123 xml_parser_free($xml_parser);
139 if (strstr(
$name,
" ")) {
142 $this->success =
false;
149 if ($this->depth == 1) {
153 if ($this->depth == 3) {
155 $this->current =
array(
"name" =>
$tag,
"ns" => $ns,
"status"=> 200);
156 if ($this->mode ==
"set") {
157 $this->current[
"val"] =
"";
161 if ($this->depth >= 4) {
162 $this->current[
"val"] .=
"<$tag";
163 foreach ($attr as
$key => $val) {
164 $this->current[
"val"] .=
' ' .
$key .
'="' . str_replace(
'"',
'"', $val) .
'"';
166 $this->current[
"val"] .=
">";
184 if (strstr(
$name,
" ")) {
187 $this->success =
false;
196 if ($this->depth >= 4) {
197 $this->current[
"val"] .=
"</$tag>";
200 if ($this->depth == 3) {
201 if (isset($this->current)) {
203 unset($this->current);
218 if (isset($this->current)) {
219 $this->current[
"val"] .=
$data;
__construct($path)
constructor
_endElement($parser, $name)
tag end handler
Create styles array
The data for the language used.
_data($parser, $data)
input data handler
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
_startElement($parser, $name, $attrs)
tag start handler