Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrey Nikishaev  >  XML Tools  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: XML Tools
Parse and validate XML documents
Author: By
Last change:
Date: 2011-11-16 03:13
Size: 557 bytes
 

Contents

Class file image Download
<?php

require_once "XMLTools.php";

$xmltools = new XMLTools();

$isvalid $xmltools->ValidateXML('test_ok.xml','test.xsd'); 
if(
$isvalid === True) {  
    
// return True
    
$data $xmltools->XML2Array('test_ok.xml');
    
print_r($data);
} else {
    
// returned array of errors
    
print_r($isvalid);
}

$isvalid $xmltools->ValidateXML('test_error.xml','test.xsd'); 
if(
$isvalid === True) {  
    
// return True
    
$data $xmltools->XML2Array('test_error.xml');
    
print_r($data);
} else {
    
// returned array of errors
    
print_r($isvalid);
}