-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SimplXML driver to traverse XML documents
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |