You are here

function XMLSchema::parseFile in Salesforce Suite 5

Same name in this branch
  1. 5 includes/nusoap.php \XMLSchema::parseFile()
  2. 5 includes/nusoap.orig.php \XMLSchema::parseFile()
Same name and namespace in other branches
  1. 5.2 includes/nusoap.php \XMLSchema::parseFile()
  2. 5.2 includes/nusoap.orig.php \XMLSchema::parseFile()

parse an XML file

@access public

Parameters

string $xml, path/URL to XML file:

string $type, (schema | xml): * @return boolean

2 calls to XMLSchema::parseFile()
XMLSchema::XMLSchema in includes/nusoap.php
* constructor * *
XMLSchema::XMLSchema in includes/nusoap.orig.php
* constructor * *

File

includes/nusoap.orig.php, line 1070

Class

XMLSchema
parses an XML Schema, allows access to it's data, other utility methods no validation... yet. very experimental and limited. As is discussed on XML-DEV, I'm one of the people that just doesn't have time to read the spec(s) thoroughly,…

Code

function parseFile($xml, $type) {

  // parse xml file
  if ($xml != "") {
    $xmlStr = @join("", @file($xml));
    if ($xmlStr == "") {
      $msg = 'Error reading XML from ' . $xml;
      $this
        ->setError($msg);
      $this
        ->debug($msg);
      return false;
    }
    else {
      $this
        ->debug("parsing {$xml}");
      $this
        ->parseString($xmlStr, $type);
      $this
        ->debug("done parsing {$xml}");
      return true;
    }
  }
  return false;
}