server-php-xml-class-xml-check-class-xml-check.php / php
<?php //#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
###
// Title : Class XML_check // Version : 1.0 // Author : Luis Argerich (lrargerich@yahoo.com) // Last modification date : 07-10-2002 // Description : A class to check if documents are well formed // XML reporting error msg,line and col if not or // statistics about the document if it is well formed. //#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
###
// History: // 07-10-2002 : First version of this class. //#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
###
// To-Dos: // //#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
###
// How to use it: // Read the documentation in class_xml_check.html //#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
###
class XML_check { var error_line; var error_msg; var elements; var texts; var this->error_code; } function get_error_line() { return this->error_col; } function get_error_msg() { return this->error_msg." at line:".this->error_col; } function get_xml_size() { return this->elements; } function get_xml_attributes() { return this->texts; } function get_xml_text_size() { return url) { this->parser = xml_parser_create_ns("",'^'); xml_set_object(this); xml_parser_set_option(this->parser, "_startElement", "_endElement"); xml_set_character_data_handler(fp = fopen(this->error="Cannot open data = fread(this->size+=strlen(this->parser, fp))) { this->parser); this->parser); this->parser); this->error_code); return false; } } xml_parser_free(this->error_code = ''; error_line = ''; error_col = ''; error_msg = ''; size = 0; elements = 0; attributes = 0; texts = 0; text_size = 0; } function _startElement(name,this->elements++; attrs); } function _endElement(name) { } function _data(data) { this->text_size+=strlen(xml) { this->parser = xml_parser_create_ns("",'^'); xml_set_object(this); xml_parser_set_option(this->parser, "_startElement", "_endElement"); xml_set_character_data_handler(this->size+=strlen(this->parser, this->error_code = xml_get_error_code(this->error_line = xml_get_current_line_number(this->error_col = xml_get_current_column_number(this->error_msg = xml_error_string(this->parser); return true; } } ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.