<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 20 May 2013 01:17:21 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Francois Zaninotto's Blog: Validating a YAML file against a schema in PHP ]]></title>
      <guid>http://www.phpdeveloper.org/news/11081</guid>
      <link>http://www.phpdeveloper.org/news/11081</link>
      <description><![CDATA[<p>
<i>Francois Zaninotto</i> submitted a <a href="http://redotheweb.com/2008/09/09/validating-a-yaml-file-against-a-schema-in-php/">tutorial he's written up</a> about creating a YAML validation script with PHP.
</p>
<blockquote>
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.
</blockquote>
<p>
He points out that Ruby has a tool for this (<a href="http://www.kuwata-lab.com/kwalify/">kwalify</a>) but PHP doesn't. He creates his own with the help of the <A href="http://trac.symfony-project.org/browser/branches/1.1/lib/yaml">sfYaml</a> 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 <a href="http://php.net/schemaValidate">schemaValidate</a> function to check it against the given schema.
</p>]]></description>
      <pubDate>Wed, 24 Sep 2008 12:58:35 -0500</pubDate>
    </item>
  </channel>
</rss>
