0

I need to search and retrieve nillable elements from an XSD scheme file. I tried treating the XSD scheme as a text file and iterating over the lines using "strpos" function with "nillable" to print the element line:

public function echo_nillables(){
   $handle = fopen("filename.xsd");
   if($handle){
      while (($line = fgets($handle)) !== false){
         if(strpos($line, "nillable"){
            echo $line;
         }
      }
   }
}

but the fgets seems to ignore the xsd scheme lines and handle them like blank lines, resulting nothing to be echoed. is there a workaround or any other way to do it? all I need is for the function to echo the nillable line/element. Thanks.

BoooYaKa
  • 1,851
  • 2
  • 14
  • 16
  • Possible duplicate of [How do you parse and process HTML/XML in PHP?](http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php) – user3942918 Mar 11 '17 at 12:38
  • @PaulCrovella I am just wondering why I cannot iterate over xsd file lines with fgets. it just ignores them. – BoooYaKa Mar 11 '17 at 13:26

0 Answers0