Location: PHPKode > projects > Mocovie web framework > mocovi/definitions/validateFilesystem.php
<?php

require_once('createMaster.php');

libxml_use_internal_errors(true);

$fs = new DomDocument();
$fs->load('../filesystems/mocovi.de.xml');
if($result = @$fs->relaxNGValidateSource($relaxNG->saveXML()))
	echo 'Works fine';
else
	echo 'Failure';

function libxml_display_error($error)
{
	$return = "<br/>\n";
	switch ($error->level)
	{
		case LIBXML_ERR_WARNING:
			$return .= "<b>Warning $error->code</b>: ";
			break;
		case LIBXML_ERR_ERROR:
			$return .= "<b>Error $error->code</b>: ";
			break;
		case LIBXML_ERR_FATAL:
			$return .= "<b>Fatal Error $error->code</b>: ";
			break;
	}
	$return .= trim($error->message);
	if ($error->file)
		$return .= " in <b>$error->file</b>";
	$return .= " on line <b>$error->line</b>\n";
	return $return;
}

function libxml_display_errors()
{
	$errors = libxml_get_errors();
	foreach ($errors as $error)
	print libxml_display_error($error);
	libxml_clear_errors();
}
libxml_display_errors();
echo $result;
Return current item: Mocovie web framework