$17 GRAYBYTE WORDPRESS FILE MANAGER $44

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/var/softaculous/sitepad/editor/site-data/plugins/pagelayer/lib/pquery/

HOME
Current File : /var/softaculous/sitepad/editor/site-data/plugins/pagelayer/lib/pquery//gan_xml2array.php
<?php
/**
 * @author Niels A.D.
 * @author Todd Burry <[email protected]>
 * @copyright 2010 Niels A.D., 2014 Todd Burry
 * @license http://opensource.org/licenses/LGPL-2.1 LGPL-2.1
 * @package pQuery
 */

namespace pagelayerQuery;

/**
 * Converts a XML document to an array
 */
class XML2ArrayParser extends HtmlParserBase {

	/**
	 * Holds the document structure
	 * @var array array('name' => 'tag', 'attrs' => array('attr' => 'val'), 'childen' => array())
	 */
	var $root = array(
		'name' => '',
		'attrs' => array(),
		'children' => array()
	);

	/**
	 * Current parsing hierarchy
	 * @var array
	 * @access private
	 */
	var $hierarchy = array();

	protected function parse_hierarchy($self_close) {
		if ($this->status['closing_tag']) {
			$found = false;
			for ($count = count($this->hierarchy), $i = $count - 1; $i >= 0; $i--) {
				if (strcasecmp($this->hierarchy[$i]['name'], $this->status['tag_name']) === 0) {

					for($ii = ($count - $i - 1); $ii >= 0; $ii--) {
						$e = array_pop($this->hierarchy);
						if ($ii > 0) {
							$this->addError('Closing tag "'.$this->status['tag_name'].'" while "'.$e['name'].'" is not closed yet');
						}
					}

					$found = true;
					break;
				}
			}

			if (!$found) {
				$this->addError('Closing tag "'.$this->status['tag_name'].'" which is not open');
			}
		} else {
			$tag = array(
				'name' => $this->status['tag_name'],
				'attrs' => $this->status['attributes'],
				'children' => array()
			);
			if ($this->hierarchy) {
				$current =& $this->hierarchy[count($this->hierarchy) - 1];
				$current['children'][] = $tag;
				$tag =& $current['children'][count($current['children']) - 1];
				unset($current['tagData']);
			} else {
				$this->root = $tag;
				$tag =& $this->root;
				$self_close = false;
			}
			if (!$self_close) {
				$this->hierarchy[] =& $tag;
			}
		}
	}

	function parse_tag_default() {
		if (!parent::parse_tag_default()) {return false;}

		if ($this->status['tag_name'][0] !== '?') {
			$this->parse_hierarchy(($this->status['self_close']) ? true : null);
		}
		return true;
	}

	function parse_text() {
		parent::parse_text();
		if (($this->status['text'] !== '') && $this->hierarchy) {
			$current =& $this->hierarchy[count($this->hierarchy) - 1];
			if (!$current['children']) {
				$current['tagData'] = $this->status['text'];
			}
		}
	}

	function parse_all() {
		return ((parent::parse_all()) ? $this->root : false);
	}
}

?>


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 Feb 2026 2.55 AM
root / root
0755
IQuery.php
5.273 KB
18 Feb 2026 11.32 PM
root / root
0644
LICENSE
25.907 KB
18 Feb 2026 11.32 PM
root / root
0644
README.md
1.975 KB
18 Feb 2026 11.32 PM
root / root
0644
composer.json
0.684 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_formatter.php
13.183 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_node_html.php
74.032 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_parser_html.php
24.512 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_selector_html.php
23.871 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_tokenizer.php
15.803 KB
18 Feb 2026 11.32 PM
root / root
0644
gan_xml2array.php
2.474 KB
18 Feb 2026 11.32 PM
root / root
0644
ganon.php
2.651 KB
18 Feb 2026 11.32 PM
root / root
0644
pQuery.php
7.278 KB
18 Feb 2026 11.32 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF