You are here

function JSimpleXML::loadFile in Ubercart 5

Interprets an XML file into an object

This function will convert the well-formed XML document in the file specified by filename to an object of class JSimpleXMLElement. If any errors occur during file access or interpretation, the function returns FALSE.

Parameters

string Path to xml file containing a well-formed XML document:

string currently ignored:

Return value

boolean True if successful, false if file empty

File

uc_store/includes/simplexml.php, line 183

Class

JSimpleXML
SimpleXML implementation.

Code

function loadFile($path, $classname = null) {

  //Get the XML document loaded into a variable
  $xml = trim(file_get_contents($path));
  if ($xml == '') {
    return false;
  }
  else {
    $this
      ->_parse($xml);
    return true;
  }
}