<?php 
 
include("xmlDB.class.php"); 
 
$xml = new xmlDB("file.xml", "user"); 
 
// uncomment the lines below to activate the functions of the class. 
 
// INSERT PROCEDURE: 
/* 
$user = array(); 
$user["code"] = 1; 
$user["name"] = "John Doe"; 
$user["email"] = "[email protected]"; 
$xml ->addItem($user); 
*/ 
 
 
 
 
// RETRIVE ONDE RECORD: 
/* 
$user = array(); 
$user = $xml -> find(1); 
 
foreach ($user as $key => $value) { 
    printf("%s: %s <br>", $key, $value); 
} 
*/ 
 
 
 
 
// RETRIVE ALL RECORDS 
/* 
$user = $xml -> xmlContent; 
 
foreach ($user as $key => $value) { 
 
    foreach ($value as $vKey => $vValue) { 
        printf("%s: %s <br>", $vkey, $vvalue); 
    } 
    print("<br>"); 
} 
*/ 
 
 
 
 
// EDIT PROCEDURE: 
/* 
$user = array(); 
$user["code"] = 1; 
$user["name"] = "Carl Doe"; 
$user["email"] = "[email protected]"; 
$xml -> editItem(1, $user); 
*/ 
 
 
 
 
// DELETE PROCEDURE: 
/* 
$xml -> removeItem(1); 
*/ 
?> 
 
 |