src/XML/Validator.php
public function validate( $xml )
	{
		$parser	= xml_parser_create();
		$dummy	= create_function( '', '' );
		xml_set_element_handler( $parser, $dummy, $dummy );
		xml_set_character_data_handler( $parser, $dummy );
		if( !xml_parse( $parser, $xml ) )
		{
			$msg	= "%s at line %d";
			$error	= xml_error_string( xml_get_error_code( $parser ) );
			$line	= xml_get_current_line_number( $parser );
			$this->error['message']	= sprintf( $msg, $error, $line );
			$this->error['line']	= $line;
			$this->error['xml']		= $xml;
			xml_parser_free( $parser );
			return FALSE;
		}
		xml_parser_free( $parser );
		return TRUE;
	}
public function validate( $xml )
	{
		$parser	= xml_parser_create();
		$dummy	= create_function( '', '' );
		xml_set_element_handler( $parser, $dummy, $dummy );
		xml_set_character_data_handler( $parser, $dummy );
		if( !xml_parse( $parser, $xml ) )
		{
			$msg	= "%s at line %d";
			$error	= xml_error_string( xml_get_error_code( $parser ) );
			$line	= xml_get_current_line_number( $parser );
			$this->error['message']	= sprintf( $msg, $error, $line );
			$this->error['line']	= $line;
			$this->error['xml']		= $xml;
			xml_parser_free( $parser );
			return FALSE;
		}
		xml_parser_free( $parser );
		return TRUE;
	}
public function validate ( $ xml ) { $ parser = xml_parser_create ( ) ; $ dummy = create_function ( '' , '' ) ; xml_set_element_handler ( $ parser , $ dummy , $ dummy ) ; xml_set_character_data_handler ( $ parser , $ dummy ) ; if ( ! xml_parse ( $ parser , $ xml ) ) { $ msg = "%s at line %d" ; $ error = xml_error_string ( xml_get_error_code ( $ parser ) ) ; $ line = xml_get_current_line_number ( $ parser ) ; $ this -> error [ 'message' ] = sprintf ( $ msg , $ error , $ line ) ; $ this -> error [ 'line' ] = $ line ; $ this -> error [ 'xml' ] = $ xml ; xml_parser_free ( $ parser ) ; return FALSE ; } xml_parser_free ( $ parser ) ; return TRUE ; }
Validates XML File.
@access		public
@param		string		$xml		XML String to validate
@return		bool
Validates XML File .