title: Getting XSD content using PHP
body: <p>I need to extract the content of an XSD file using PHP. <strong>I don't want to validate it against an XML</strong>; I just need to take some nodes and check some attributes.</p>
  
  <p>Here is my XSD example:</p>
  
  <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;xsd:import namespace="http://www.opengis.net/gml" schemaLocation="somelocation.xsd" /&gt; 
    &lt;xsd:complexType name="nameType"&gt;
      &lt;xsd:complexContent&gt;
         &lt;xsd:extension base="gml:AbstractFeatureType"&gt;
           &lt;xsd:sequence&gt;
               &lt;xsd:element maxOccurs="1" minOccurs="0" name="x" nillable="true" type="xsd:int" /&gt; 
               &lt;xsd:element maxOccurs="1" minOccurs="0" name="y" nillable="true" type="xsd:int" /&gt; 
               &lt;xsd:element maxOccurs="1" minOccurs="0" name="z" nillable="true" type="xsd:decimal" /&gt; 
           &lt;/xsd:sequence&gt;
         &lt;/xsd:extension&gt;
    &lt;/xsd:complexContent&gt;
    &lt;/xsd:complexType&gt;
    &lt;xsd:element name="lz_anual_250" substitutionGroup="gml:_Feature" type="layerType" /&gt; 
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>I don't know if this is possible, so I'm just asking to an expert on StackOverflow.</p>
  
  <p>Thanks!</p>
  
  <p>PS: I'm using CodeIgniter, so if anyone know any extension or similar to do this, post here please.</p>
  
  <p>EDIT: Problem solved!</p>
  
  <p>Here is a link that could help someone with the same problem as me:</p>
  
  <p><a href="http://www.php.net/manual/en/domdocument.load.php#57911" rel="nofollow">http://www.php.net/manual/en/domdocument.load.php#57911</a></p>
  
  <p>Simply, someone used DOMXPath class to navigate through the XSD read before using DOMDocument class (like rik told me). The XSD wasn't empty. I was trying to print_r, var_dump and echo the nodes but, obviously there wasn't contain info like a classical XML.</p>