News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Francois Zaninotto's Blog:
Validating a YAML file against a schema in PHP
September 24, 2008 @ 12:58:35

Francois Zaninotto submitted a tutorial he's written up about creating a YAML validation script with PHP.

As of today, there is no simple way to validate the syntax of a YAML file in PHP. But with two simple tricks, it takes only a few dozens of lines of code to build a robust validator capable of checking the syntax of any YAML file against a given schema.

He points out that Ruby has a tool for this (kwalify) but PHP doesn't. He creates his own with the help of the sfYaml component from the symfony framework, translating the YAML data into something PHP can parse more easily - XML. He passes this through an XSL parser and uses the DOM XML schemaValidate function to check it against the given schema.

0 comments voice your opinion now!
yaml validate tutorial schema xsl domxml sfyaml symfony framework



Similar Posts

Eirik Hoem's Blog: Prado Framework 3.1.2 released

DevShed: Using Recursive Methods in Object-based PHP Applications (Part 2)

The Bakery: Three New Components/Tutorials - Lightroom, DboSource & SMF

Chris Hartjes' Blog: My Next Foolish Project: A console for CakePHP

AnyExample.com: PHP AJAX example: asynchronous file upload


Community Events









Don't see your event here?
Let us know!


developer PEAR cakephp example code application PHP5 zend conference security releases ajax framework database book zendframework job mysql package release

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework