public function __construct() { parent::__construct('1.0', 'UTF-8'); $this->formatOutput = true; $this->rootElement = $this->createElement('testsuites'); $this->appendChild($this->rootElement); }
public function __construct($text) { parent::__construct(); $this->preserveWhiteSpace = false; $this->LoadXML($text); $this->formatOutput = true; }
public function __construct() { parent::__construct('1.0', 'UTF-8'); $this->preserveWhiteSpace = false; $this->formatOutput = true; return $this; }
public function __construct($data, $version = null, $encoding = null) { parent::__construct($version, $encoding); $this->registerNodeClass('DOMDocument', 'JS_Extractor'); $this->registerNodeClass('DOMElement', 'JS_Extractor_Element'); @$this->loadHTML($data); }
public function __construct($version = '1.0', $encoding = 'utf-8') { parent::__construct($version, $encoding); $this->registerNodeClass('DOMAttr', 'Libs\\DOM\\Attribute'); $this->registerNodeClass('DOMDocument', 'Libs\\DOM\\Document'); $this->registerNodeClass('DOMElement', 'Libs\\DOM\\Element'); }
/** * Constructor de la clase. * * @access public * @param string $xml (la ruta del archivo XML) */ public function __construct($xml = null) { parent::__construct('1.0', 'utf-8'); if ($this->load($xml) === true) { $this->carga = true; } }
/** * 构造函数 * @param string $fileName xml文件名 * @param bool $isSax 是否存储成SimpleXMLElement对象 */ public function __construct($fileName = '', $isSax = true, $version = '1.0', $encoding = 'utf-8') { parent::__construct($version, $encoding); $this->fileName = $fileName; $this->isSax = $isSax; $this->fileName && $this->loadFromFile(); }
/** * @param string $version * @param string $encoding */ public function __construct($version = '1.0', $encoding = 'UTF-8') { parent::__construct($version, $encoding); foreach ($this->_classes as $superClass => $className) { $this->registerNodeClass($superClass, __NAMESPACE__ . $className); } }
/** * Creates the <salesinvoice> element and adds it to the property * salesInvoicesElement * * @access public */ public function __construct() { parent::__construct(); // Make the main wrap element $this->salesInvoicesElement = $this->createElement('salesinvoices'); $this->appendChild($this->salesInvoicesElement); }
public function __construct($version = null, $encoding = null) { parent::__construct($version, $encoding); $this->registerNodeClass('DOMText', 'DOMWrap\\Text'); $this->registerNodeClass('DOMElement', 'DOMWrap\\Element'); $this->registerNodeClass('DOMComment', 'DOMWrap\\Comment'); }
public function __construct($version = '1.0', $encoding = 'utf-8') { parent::__construct($version, $encoding); $this->preserveWhitespace = false; $this->formatOutput = false; $this->_errorLog = array(); }
public function __construct() { parent::__construct('1.0', 'utf-8'); $this->registerNodeClass('DOMElement', 'app\\modules\\yiipass\\services\\KeepassXGroup'); $db = $this->createElement('database'); $this->appendChild($db); $this->db = $db; }
function __construct() { $this->sessionid = uniqid(); parent::__construct('1.0', 'UTF-8'); $this->formatOutput = true; //$this->standalone = false; #$this->validateOnParse = true; }
/** * Creates a new response xml document to iterate * through its resource properties * @param string $xml_response_string */ public function __construct($xml_response_string) { parent::__construct(self::XML_VERSION, self::XML_ENCODING); $this->loadXML($xml_response_string); if ($this->success() === true) { $this->__resourceNodeList = $this->getElementsByTagName('resourceDescriptor'); } }
/** * constructor * set up an Atom_Element instance * * @param string $tagName * @example * $feed = new Atom_Element('feed') * is similar to * $feed = new DOMDocument; * $feed->appendChild(new DOMElement('feed')) * @access public */ public function __construct($tagName='') { parent::__construct(); if($tagName!='' && $tagName!=null) { $this->appendChild(new DOMElement($tagName)); } }
/** * Class constructor * * @return unknown_type */ public function __construct() { parent::__construct(); $this->registerNodeClass('DOMAttr', 'Q\\HTTPd_DOMAttr'); $this->registerNodeClass('DOMElement', 'Q\\HTTPd_DOMElement'); $this->registerNodeClass('DOMComment', 'Q\\HTTPd_DOMComment'); $this->appendChild($this->createSection('_')); }
/** * Class constructor. * * @param void * @return void */ public function __construct() { parent::__construct(); $this->formatOutput = TRUE; $rssElement = $this->createElement('rss'); $rssElement->setAttribute('version', '2.0'); $this->rss = $this->appendChild($rssElement); }
/** * Create a new DOMDocument with SVG as the documentElement * * @param array $attrs Array of attributes to set * @param string $charset Character encoding to use */ public function __construct(array $attrs = array(), $charset = self::CHARSET) { parent::__construct('1.0', $charset); $this->registerNodeClass('\\DOMElement', '\\' . __NAMESPACE__ . '\\' . 'XMLElement'); $this->appendChild($this->createElementNS(self::XMLNS, 'svg')); $attrs['version'] = self::VERSION; array_map([$this->documentElement, 'setAttribute'], array_keys($attrs), array_values($attrs)); }
public function __construct() { parent::__construct('1.0', 'utf-8'); $data = $this->createElementNS($this->namespace, 'data'); $this->appendChild($data); $this->XPath = new DOMXPath($this); $this->XPath->registerNamespace('default', $this->namespace); }
/** * @param string|null $sDesignSourceId Identifier of the section module_design (generally a module name), null to build an empty design * @throws Exception */ public function __construct($sDesignSourceId = null) { parent::__construct('1.0', 'UTF-8'); $this->Init(); if (!is_null($sDesignSourceId)) { $this->LoadFromCompiledDesigns($sDesignSourceId); } }
/** * The constructor. * Will auto-register Agavi DOM node classes and create an XPath instance. * * @param string The XML version. * @param string The XML encoding. * * @see DOMDocument::__construct() * * @author David Zülke <*****@*****.**> * @since 1.0.0 */ public function __construct($version = "1.0", $encoding = "UTF-8") { parent::__construct($version, $encoding); foreach ($this->nodeClassMap as $domClass => $agaviClass) { $this->registerNodeClass($domClass, $agaviClass); } $this->xpath = new DOMXPath($this); }
public function __construct($version = '1.0', $encoding = 'utf-8') { parent::__construct($version, $encoding); $this->preserveWhiteSpace = false; $this->formatOutput = true; $this->strictErrorChecking = false; $this->parse_entities(); }
/** * Creates a new DomDocument instance. * * @param string $version * @param string $encoding */ public function __construct($version = "1.0", $encoding = "UTF-8") { parent::__construct($version, $encoding); foreach ($this->class_map as $dom_class => $environaut_class) { $this->registerNodeClass($dom_class, $environaut_class); } $this->xpath = new \DOMXPath($this); }
public function __construct($version = '1.0', $encoding = 'utf-8') { parent::__construct($version, $encoding); $this->registerNodeClass('DOMDocument', 'XMLDocument'); $this->registerNodeClass('DOMElement', 'SymphonyDOMElement'); $this->preserveWhitespace = false; $this->formatOutput = false; $this->errors = new MessageStack(); }
/** * Creates the <Match> element and adds it to the property * MatchElement * * @access public */ public function __construct() { parent::__construct(); $this->matchElement = $this->createElement('match'); $this->appendChild($this->matchElement); // Make header element $this->setElement = $this->createElement('set'); $this->matchElement->appendChild($this->setElement); }
/** * Create a new BetterDOMDocument * * @param mixed $xml * $xml can either be an XML string, a DOMDocument, or a DOMElement. * You can also pass FALSE or NULL (or omit it) and load XML later using loadXML or loadHTML * * @param mixed $auto_register_namespaces * Auto-register namespaces. All namespaces in the root element will be registered for use in xpath queries. * Namespaces that are not declared in the root element will not be auto-registered * Defaults to TRUE (Meaning it will auto register all auxiliary namespaces but not the default namespace). * Pass a prefix string to automatically register the default namespace. * Pass FALSE to disable auto-namespace registeration * * @param bool $error_checking * Can be 'strict', 'warning', or 'none. Defaults to 'strict'. * 'none' supresses all errors * 'warning' is the default behavior in DOMDocument * 'strict' corresponds to DOMDocument strictErrorChecking TRUE */ function __construct($xml = FALSE, $auto_register_namespaces = TRUE, $error_checking = 'strict') { parent::__construct(); // Check up error-checking if ($error_checking == FALSE) { $this->error_checking = 'none'; } else { $this->error_checking = $error_checking; } if ($this->error_checking != 'strict') { $this->strictErrorChecking = FALSE; } if (is_object($xml)) { $class = get_class($xml); if ($class == 'DOMElement') { $this->appendChild($this->importNode($xml, true)); } if ($class == 'DOMDocument') { if ($xml->documentElement) { $this->appendChild($this->importNode($xml->documentElement, true)); } } if ($class == 'BetterDOMDocument') { if ($xml->documentElement) { $this->appendChild($this->importNode($xml->documentElement, true)); } $this->ns = $xml->ns; $this->default_ns = $xml->default_ns; } } if ($xml && is_string($xml)) { if ($this->error_checking == 'none') { @$this->loadXML($xml); } else { if (!$this->loadXML($xml)) { trigger_error('BetterDOMDocument: Could not load: ' . htmlspecialchars($xml), E_USER_WARNING); } } // There is no way in DOMDocument to auto-detect or list namespaces. // Regretably the only option is to parse the first container element for xmlns psudo-attributes if ($auto_register_namespaces) { $this->auto_ns = TRUE; if (preg_match('/<[^\\?^!].+?>/s', $xml, $elem_match)) { if (preg_match_all('/xmlns:(.+?)=.*?["\'](.+?)["\']/s', $elem_match[0], $ns_matches)) { foreach ($ns_matches[1] as $i => $ns_key) { $this->registerNamespace(trim($ns_key), trim($ns_matches[2][$i])); } } } // If auto_register_namespaces is a prefix string, then we register the default namespace to that string if (is_string($auto_register_namespaces) && $this->documentElement->getAttribute('xmlns')) { $this->registerNamespace($auto_register_namespaces, $this->documentElement->getAttribute('xmlns')); $this->default_ns = $auto_register_namespaces; } } } }
public function __construct($content, $load = true, $encoding = "UTF-8") { parent::__construct("1.0", $encoding); libxml_use_internal_errors(true); if ($load && !@$this->loadHTML('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $content)) { return; } $this->isValidHTML = true; }
/** * construtor * Executa o construtor-pai do DOMDocument e por padrão define o XML sem espaços * e sem identação * @param string $sXml Conteúdo XML opcional a ser carregado no DOM Document. * @return void */ public function __construct($sXml = NULL) { parent::__construct('1.0', 'utf-8'); $this->formatOutput = false; $this->preserveWhiteSpace = false; if (is_string($sXml)) { $this->loadXML($sXml, LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG); } }
public function __construct() { parent::__construct('1.0', 'utf-8'); $this->encoding = 'utf-8'; $this->recover = true; $this->registerNodeClass('DOMElement', '\\Lampcms\\Dom\\Element'); //$this->registerNodeClass('DOMNode', '\Lampcms\Dom\Node'); //$this->registerNodeClass('DOMText', '\Lampcms\Dom\Text'); }
/** * Constructs a new log file instance for the given file. * * @param string $fileName Path of a cc log file. */ public function __construct($fileName) { parent::__construct(); $this->load($fileName); // Extract timestamp from file name preg_match('/log([0-9]+)/', basename($fileName), $match); $this->properties['timestamp'] = $match[1]; $this->properties['fileName'] = $fileName; }