public static function load($source, $contentType = 'text/xml', array $options = [])
{
if (!isset(self::$_loader)) {
self::$_loader = self::getDefaultLoaders();
}
$result = self::$_loader->load($source, $contentType, $options);
return $result instanceof \DOMDocument ? $result : $result->getDocument();
}
/** * Function to create a new FluentDOM instance and loads data into it if * a valid $source is provided. * * @param mixed $source * @param string $contentType optional, default value 'text/xml' * @return FluentDOM */ function FluentDOM($source = NULL, $contentType = 'text/xml') { $result = new FluentDOM(); if (isset($source)) { return $result->load($source, $contentType); } else { return $result; } }