title: PHP SimpleXMLElement validation with XSD
body: <p>is it possible to validate a SimpleXMLElement with an XSD shema stored in a string?</p>
  
  <p>I get this xml trough CURL:</p>
  
  <pre><code>&lt;production_feedback&gt;
          &lt;production_number&gt;DA1100208&lt;/production_number&gt;
      &lt;production_status&gt;DONE&lt;/production_status&gt;
  &lt;/production_feedback&gt;
  </code></pre>
  
  <p>On my side i get it like this: </p>
  
  <pre><code>if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
  
      $post_text = file_get_contents('php://input');
  
      $xml = new SimpleXMLElement($post_text);
  
      error_log(print_r($xml , true));
      }
  </code></pre>
  
  <p>This is in my <code>error_log()</code> :</p>
  
  <pre><code>SimpleXMLElement Object\n(\n    [production_number] =&gt; DA1100208\n    [production_status] =&gt; PRODUCTION_IN_PROGRESS\n)\n
  </code></pre>
  
  <p>So i can access the data with Xpath. This works well. I would like to validate it with an XSD. Is it possible, or is there any other way 2 validate the XML string with the XSD string?</p>
  
  <p>this is my XSD btw stored in a variable:</p>
  
  <pre><code>$production_XSD ='&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;xs:element name="production_feedback"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element type="xs:string" name="production_number"/&gt;
          &lt;xs:element type="xs:string" name="production_status"/&gt;
        &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;'
  </code></pre>