diff options
| author | Hartmut Holzgraefe <hholzgra@php.net> | 2003-06-29 12:21:58 +0000 |
|---|---|---|
| committer | Hartmut Holzgraefe <hholzgra@php.net> | 2003-06-29 12:21:58 +0000 |
| commit | 7218a70ff684e476a2fd4f0ed75a466de5f5c724 (patch) | |
| tree | dd197ca646a537e508e45f6e249f434b3cb119e3 /scripts/ext_skel_ng/xml_stream_parser.php | |
| parent | 4aa81c9d72395c5f8ca0a6decef51c6eff1904be (diff) | |
| download | php-git-7218a70ff684e476a2fd4f0ed75a466de5f5c724.tar.gz | |
ext_skel is no more, and ext_skel_ng is moving to PEAR::PECL_Gen
Diffstat (limited to 'scripts/ext_skel_ng/xml_stream_parser.php')
| -rw-r--r-- | scripts/ext_skel_ng/xml_stream_parser.php | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/scripts/ext_skel_ng/xml_stream_parser.php b/scripts/ext_skel_ng/xml_stream_parser.php deleted file mode 100644 index fe0a4c9ad7..0000000000 --- a/scripts/ext_skel_ng/xml_stream_parser.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -class xml_stream_parser { - var $parser; - - function __construct($stream) - { - if (!is_resource($stream)) die("not a stream"); - if (get_resource_type($stream) != "stream") die("not a stream"); - - $this->parser = xml_parser_create(); - - xml_set_object($this->parser, $this); - xml_set_element_handler($this->parser, "tag_open", "tag_close"); - xml_set_character_data_handler($this->parser, "cdata"); - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); - - while (!feof($stream)) { - xml_parse($this->parser, fgets($stream), feof($stream)); - } - xml_parser_free($this->parser); - } - - function tag_open($parser, $tag, $attributes) - { - var_dump($parser, $tag, $attributes); - } - - function cdata($parser, $cdata) - { - var_dump($parser, $cdata); - } - - function tag_close($parser, $tag) - { - var_dump($parser, $tag); - } - - function error($msg) - { - if (is_array($msg)) { - if (count($msg)==1) { - $msg = current($msg); - } else { - foreach ($msg as $text) { - echo "$text\n"; - } - $msg = "..."; - } - } - - die("$msg on line ".xml_get_current_line_number($this->parser)); - } -} // end of class xml -?>
\ No newline at end of file |
