Login   Register  
PHP Classes

Input Validator: Validate of nested arrays using XML schema rules

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Tom Schaefer
Name: Tom Schaefer is available for providing paid consulting. Contact Tom Schaefer .
Classes: 39 packages by
Country: Germany Germany
Age: ???
All time rank: 1109 in Germany Germany
Week rank: 88 Up4 in Germany Germany Up
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

  Detailed description   Download Download .zip .tar.gz  
This class can validate of nested arrays using XML schema rules.

It can take an example of associative array with valid values and converts it internally to validation rules defined in XML Schema Definitions (XSD).

An actual array of data, which can eventually be the $_POST request values, can be validated with the rules determined from the sample data.

It can also generate a XML Schema Definition file that can be edited separately to add more complex validation rules. The edited XSD file or string can also be used as input to define the validation rules.

The class supports validating values of different types, such as: boolean, integer, float, string, date, time, timestamp, array, object.

  Classes of Tom Schaefer  >  Input Validator  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Input Validator
Base name: nestedarrayvalidator
Description: Validate of nested arrays using XML schema rules
Version: 0.1
PHP version: 5.0
License: MIT/X Consortium License
All time users: 354 users
All time rank: 6165
Week users: 1 user
Week rank: 1467 Up
  Groups   Rate classes User ratings   Applications   Related pages   Files Files  

Group folder image XML XML parsing and generation View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Validation Validation algorithms View top rated classes

  Innovation Award  
PHP Programming Innovation award nominee
June 2012
Number 4

Prize: One downloadable copy of PhpED Professional
XML Schema (XSD) is a standard for defining rules that XML element values should follow.

This class can validate arrays of values, submitted eventually using Web forms, using rules defined using XML Schema.

It can validate not only all basic types of values but also more complex element types defined as nested arrays.

The initial set of validation rules can be generated from a sample array of valid values that is passed to the class.

This way the class makes it easy to get started defining basic validation rules without requiring to learn too much about XML Schema.

Manuel Lemos

  User ratings  
Not yet rated by the users

  Applications that use this package  
Show Case
show case: send json data and definition to visualize its output
Add link image If you know an application of this package, send a message to the author to add a link here.

  Related pages  
Trang takes as input a schema (e.g. XML) and produces as output a schema (e.g. XSD).

  Files folder image Files  
File Role Description
Accessible without login Plain text file error_sample2.php Example error: unexpected type
Accessible without login Plain text file error_sample.php Example error: wrong type, expecting boolean, receiving integer
Accessible without login Plain text file error_sample3.php Example undefined key-value pair
Plain text file InputValidator.php Class class
Accessible without login Plain text file sample.php Example interface error sample
Accessible without login Plain text file sample2.php Example json to xsd using trang

Download Download all files: nestedarrayvalidator.tar.gz nestedarrayvalidator.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.