Started parser class.
This commit is contained in:
31
lib/TclUpdates/XmlParser.php
Executable file
31
lib/TclUpdates/XmlParser.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace TclUpdates;
|
||||
|
||||
class XmlParser
|
||||
{
|
||||
private $dom;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->dom = new \DOMDocument();
|
||||
}
|
||||
|
||||
public function loadXMLFromString($xml)
|
||||
{
|
||||
$xml_ok = $this->dom->loadXML($xml, LIBXML_NOENT);
|
||||
return $xml_ok;
|
||||
}
|
||||
|
||||
public function validateGOTU()
|
||||
{
|
||||
if ($this->dom->childNodes->length < 1) {
|
||||
return false;
|
||||
}
|
||||
$root_node = $this->dom->childNodes->item(0);
|
||||
if ($root_node->nodeName != 'GOTU') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
6
lib/autoloader.php
Executable file
6
lib/autoloader.php
Executable file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
set_include_path(__DIR__ . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
// PSR-4
|
||||
spl_autoload_register();
|
Reference in New Issue
Block a user