Skip to content

Commit

Permalink
Add SimplXML driver to traverse XML documents
Browse files Browse the repository at this point in the history
  • Loading branch information
hkdobrev committed Sep 3, 2015
1 parent 77f632b commit 6e7756b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/Openbuildings/Spiderling/Driver/SimpleXML.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace Openbuildings\Spiderling;

use Openbuildings\EnvironmentBackup\Environment;
use Openbuildings\EnvironmentBackup\Environment_Group_Globals;
use Openbuildings\EnvironmentBackup\Environment_Group_Server;
use Openbuildings\EnvironmentBackup\Environment_Group_Static;

/**
* Use Curl to load urls.
* In memory.
* No Javascript
*
* @package Openbuildings\Spiderling
* @author Ivan Kerin
* @copyright (c) 2013 OpenBuildings Ltd.
* @license http://spdx.org/licenses/BSD-3-Clause
*/
class Driver_SimpleXML extends Driver_Simple {

/**
* The name of the driver
* @var string
*/
public $name = 'simpleXML';

/**
* Initialze the dom, xpath and forms objects, based on the content string
*/
public function initialize()
{
@ $this->_dom->loadXML($this->content());
$this->_dom->encoding = 'utf-8';
$this->_xpath = new Driver_Simple_Xpath($this->_dom);
$this->_forms = new Driver_Simple_Forms($this->_xpath);
}
}

0 comments on commit 6e7756b

Please sign in to comment.