OpenAjax Metadata 1.0 Schema and Validation Tools
This directory contains the formal language schema for OpenAjax Metadata 1.0, along
with various tools that can be used to validate files against the schema.
(Note: The term "validate" means to run a syntax checker that verifies that the file's contents
are correct according to what is allowed and disallowed within an OpenAjax Metadata file.)
The contents of this directory:
- ValidatorPage.php -
This is a simple Web page that provides a user interface for running the validator.
The user can do any of the following:
- Upload a single OpenAjax Metadata XML file, which will be validated against the language schema.
- Upload and validate a ZIP file that contains OpenAjax Metadata XML files inside.
The validator will search for all files in the ZIP archive whose names end with the string "oam.xml"
and run the validator against all of those files.
- Supply the URL for a single OpenAjax Metadata XML file that exists on the Web.
The file will then be retrieved and validated against the language schema.
-
- Supply the URL for a ZIP file that exists on the Web.
The validator will search for all files whose names end with the string "oam.xml"
and run the validator against all of those files.
In all of the above cases, after clicking the appropriate button,
the validation results will appear in a box at the bottom
of the Web page.
- validate_url.php and validate_data.php -
These are validation web services, located in the same directory as this file.
validate_url.php accepts one request parameter, 'remoteURL', which is the URL of an
OpenAjax Metadata XML file or a ZIP file that contains OpenAjax Metadata files inside.
The service can be invoked via HTTP GET or HTTP POST:
- HTTP GET - The URL is passed as a URL-encoded URL parameter.
For example, to validate the file at
http://www.example.com/mywidget_oam.xml
You can invoke the Web service as:
/schema/OpenAjaxMetadata/1.0/validate_url.php?remoteURL=http%3A%2F%2Fwww.example.com%2Fmywidget_oam.xml
- HTTP POST - The URL is passed to the Web service via the 'remoteURL' POST parameter, and should not be URL-encoded.
validate_data.php only supports HTTP POST and accepts an OpenAjax Metadata file
as the raw POST content. This service will validate that content against the language schema.
The result value from either Web service is a JSON string with the following contents:
{
success:true|false, // true if everything validates successfully, else false
uploadedfile:string, // uploaded file
nfiles:number, // number of files processed
uploaderror: string, // error messages if upload failed
perfileresults:[ // data for each file
{
filename:string, // name of file
valid:true|false, // whether this file validated successfully
warnings:[ array-of-strings], // warning messages
errors: [ array-of-strings] // validation failure errors messages
}
]
}
- *.rnc -
The formal schema for OpenAjax Metadata is expressed as a series of
RelaxNG Compact Syntax files (i.e., *.rnc).
The main file is OpenAjaxMetadata.rnc, which
then references the other *.rnc files.
Duplicates of the *.rnc files can be found in the
OpenAjax Alliance's open source project.
Here is the list of RNC files: