PageRenderTime 299ms queryTime 34ms sortTime 3ms getByIdsTime 116ms findMatchingLines 91ms

100+ results results for 'php xml_parse' (299 ms)

Not the results you expected?
class-IXR-message.php https://gitlab.com/VTTE/sitios-vtte | PHP | 234 lines
                    
1<?php
                    
2
                    
30	/**
                    
31	 * PHP5 constructor.
                    
32	 */
                    
38	/**
                    
39	 * PHP4 constructor.
                    
40	 */
                    
47        if ( ! function_exists( 'xml_parser_create' ) ) {
                    
48            trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
                    
49            return false;
                    
91
                    
92        $this->_parser = xml_parser_create();
                    
93        // Set XML parser to take the case of tags in to account
                    
93        // Set XML parser to take the case of tags in to account
                    
94        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
                    
95        // Set XML parser callback functions
                    
                
xs_news.php https://github.com/Informpro/icy_phoenix.git | PHP | 344 lines
                    
1<?php
                    
2/**
                    
6* @copyright (c) 2008 Icy Phoenix
                    
7* @license http://opensource.org/licenses/gpl-license.php GNU Public License
                    
8*
                    
190
                    
191						$xml_parser = xml_parser_create();
                    
192						xml_set_element_handler($xml_parser, 'startElement', 'endElement');
                    
200								{
                    
201									if (!xml_parse($xml_parser, $xml_buffer, feof($fp)))
                    
202									{
                    
203										$xml_error = true;
                    
204										$xml_error_msg = sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser));
                    
205									}
                    
207
                    
208								xml_parser_free($xml_parser);
                    
209
                    
                
BitmapMetadataHandler.php https://github.com/daevid/MWFork.git | PHP | 211 lines
                    
1<?php
                    
2/**
                    
117	static function Jpeg ( $filename ) {
                    
118		$showXMP = function_exists( 'xml_parser_create_ns' );
                    
119		$meta = new self();
                    
155	static public function PNG ( $filename ) {
                    
156		$showXMP = function_exists( 'xml_parser_create_ns' );
                    
157
                    
192
                    
193		if ( $baseArray['xmp'] !== '' && function_exists( 'xml_parser_create_ns' ) ) {
                    
194			$xmp = new XMPReader();
                    
                
import.inc.php https://github.com/umbecr/camilaframework.git | PHP | 227 lines
                    
1<?php
                    
2
                    
2
                    
3/* This File is part of Camila PHP Framework
                    
4   Copyright (C) 2006-2011 Umberto Bresciani
                    
5
                    
6   Camila PHP Framework is free software; you can redistribute it and/or modify
                    
7   it under the terms of the GNU General Public License as published by
                    
10
                    
11   Camila PHP Framework is distributed in the hope that it will be useful,
                    
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
                    
44
                    
45        $xml_parser = xml_parser_create();
                    
46
                    
50            fclose($fp);
                    
51            xml_parse_into_struct($xml_parser, $data, $vals, $index);
                    
52            xml_parser_free($xml_parser);
                    
                
core_XmlTagTrace.php https://github.com/atutor/atutor_opencaps.git | PHP | 242 lines
                    
1<?php
                    
2// 
                    
61		// create XML parser
                    
62		$p = xml_parser_create();
                    
63		
                    
64		// parse XML data into array
                    
65		xml_parse_into_struct($p, $theXmlString, $xmlVals, $xmlIndex);
                    
66		
                    
67		// free XML parser 
                    
68		xml_parser_free($p);
                    
69		
                    
                
Tbx.php https://github.com/gryzz/crystal_magento.git | PHP | 179 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Tbx.php 16971 2009-07-22 18:05:45Z mikaelkael $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24#require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27#require_once 'Zend/Translate/Adapter.php';
                    
28
                    
47     * Generates the tbx adapter
                    
48     * This adapter reads with php's xml_parser
                    
49     *
                    
73        if (!is_readable($filename)) {
                    
74            #require_once 'Zend/Translate/Exception.php';
                    
75            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
                
ParserBase.php https://github.com/orchestra-io/sample-openx.git | PHP | 308 lines
                    
1<?php
                    
2
                    
27
                    
28require_once 'XML/Parser.php';
                    
29
                    
35 */
                    
36class OX_ParserBase extends XML_Parser
                    
37{
                    
47    var $aDbms      = array();
                    
48    var $aPhp       = array();
                    
49    var $aDepends   = array();
                    
61    {
                    
62        // force ISO-8859-1 due to different defaults for PHP4 and PHP5
                    
63        // todo: this probably needs to be investigated some more andcleaned up
                    
124        $this->aSyscheck['dbms']    = $this->aDbms;
                    
125        $this->aSyscheck['php']     = $this->aPhp;
                    
126        $this->aSyscheck['depends'] = $this->aDepends;
                    
                
xml_parser.php https://gitlab.com/phamngsinh/baitaplon_sinhvien | PHP | 427 lines
                    
24	if(!strcmp($xml_parser_handlers[$parser]->error,""))
                    
25		$xml_parser_handlers[$parser]->StartElement($xml_parser_handlers[$parser],$name,$attrs);
                    
26}
                    
224				$xml_parser_handlers[$this->xml_parser]=new xml_parser_handler_class;
                    
225				$xml_parser_handlers[$this->xml_parser]->xml_parser=$this->xml_parser;
                    
226				$xml_parser_handlers[$this->xml_parser]->store_positions=$this->store_positions;
                    
229			}
                    
230			xml_set_element_handler($this->xml_parser,"xml_parser_start_element_handler","xml_parser_end_element_handler");
                    
231			xml_set_character_data_handler($this->xml_parser,"xml_parser_character_data_handler");
                    
249					}
                    
250					xml_parser_free($this->xml_parser);
                    
251					$this->xml_parser=0;
                    
351		if(!($definition=@fopen($file,"r")))
                    
352			return("could not open the XML file ($file)".(IsSet($php_errormsg) ? ': '.$php_errormsg : ''));
                    
353		$error=$this->ParseStream($definition);
                    
                
XMLParser5.php https://github.com/vaughnpaul/NOS.git | PHP | 430 lines
                    
1<?php
                    
2/**
                    
16/**
                    
17 * XML Parser Class (php5)
                    
18 * 
                    
83    /**
                    
84     * Initiates and runs PHP's XML parser
                    
85     */
                    
88        //Create the parser resource
                    
89        $this->parser = xml_parser_create();
                    
90        
                    
96        //Error handling
                    
97        if (!xml_parse($this->parser, $this->xml))
                    
98            $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));
                    
100        //Free the parser
                    
101        xml_parser_free($this->parser);
                    
102    }
                    
                
AquaticPrimeEsellerateMySQL.php https://bitbucket.org/tgunr/aqpmanager.git | PHP | 250 lines
                    
103	// Work around a PHP 5.2.2 bug preventing POST data from reaching the script.
                    
104	// See <http://bugs.php.net/bug.php?id=41293> for details.
                    
105	if ($_SERVER["REQUEST_METHOD"] == "POST") {
                    
110
                    
111	$xml_parser = xml_parser_create();
                    
112	xml_set_element_handler($xml_parser, "startElement", "endElement");
                    
114
                    
115	if (!xml_parse($xml_parser, $HTTP_RAW_POST_DATA, TRUE))
                    
116	{
                    
119			xml_get_current_line_number($xml_parser));
                    
120		xml_parser_free($xml_parser);
                    
121		ReportFatalError($msg);
                    
123
                    
124	xml_parser_free($xml_parser);
                    
125
                    
                
Encoder.php https://github.com/sgtcarneiro/horde.git | PHP | 431 lines
                    
1<?php
                    
2/**
                    
69        // Create the XML parser and set method references.
                    
70        $this->_parser = xml_parser_create_ns($this->_charset);
                    
71        xml_set_object($this->_parser, $this);
                    
71        xml_set_object($this->_parser, $this);
                    
72        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
                    
73        xml_set_element_handler($this->_parser, '_startElement', '_endElement');
                    
77
                    
78        if (!xml_parse($this->_parser, $xml)) {
                    
79            throw new Horde_Xml_Wbxml_Exception(
                    
84
                    
85        xml_parser_free($this->_parser);
                    
86
                    
                
defines.inc.php https://gitlab.com/staging06/myproject | PHP | 218 lines
                    
1<?php
                    
2/**
                    
9* It is also available through the world-wide-web at this URL:
                    
10* http://opensource.org/licenses/osl-3.0.php
                    
11* If you did not receive a copy of the license and are unable to
                    
22*  @copyright  2007-2015 PrestaShop SA
                    
23*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
24*  International Registered Trademark & Property of PrestaShop SA
                    
46
                    
47if (!defined('PHP_VERSION_ID')) {
                    
48    $version = explode('.', PHP_VERSION);
                    
48    $version = explode('.', PHP_VERSION);
                    
49    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
                    
50}
                    
109}
                    
110define('_PS_PEAR_XML_PARSER_PATH_',  _PS_TOOL_DIR_.'pear_xml_parser/');
                    
111define('_PS_SWIFT_DIR_',             _PS_TOOL_DIR_.'swift/');
                    
                
Simple.php https://bitbucket.org/valmy/openx.git | PHP | 297 lines
                    
11// | http://www.php.net/license/3_0.txt.                                  |
                    
12// | If you did not receive a copy of the PHP license and are unable to   |
                    
13// | obtain it through the world-wide-web, please send a note to          |
                    
37/**
                    
38 * built on XML_Parser
                    
39 */
                    
39 */
                    
40require_once 'XML/Parser.php';
                    
41
                    
44 *
                    
45 * This class is a simplified version of XML_Parser.
                    
46 * In most XML applications the real action is executed,
                    
78 */
                    
79class XML_Parser_Simple extends XML_Parser
                    
80{
                    
                
Xmlrpcs.php https://github.com/cawago/ci_campusync_auth.git | PHP | 536 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 4.3.2 or newer
                    
6 *
                    
15
                    
16if ( ! function_exists('xml_parser_create'))
                    
17{	
                    
17{	
                    
18	show_error('Your PHP installation does not support XML');
                    
19}
                    
163		
                    
164		$parser = xml_parser_create($this->xmlrpc_defencoding);
                    
165		$parser_object = new XML_RPC_Message("filler");
                    
175		xml_set_object($parser, $parser_object);
                    
176		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
                    
177		xml_set_element_handler($parser, 'open_tag', 'closing_tag');
                    
                
Xmlrpcs.php https://bitbucket.org/myockey/clearcreek-chapel-website.git | PHP | 544 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.2.4 or newer
                    
6 *
                    
15
                    
16if ( ! function_exists('xml_parser_create'))
                    
17{
                    
17{
                    
18	show_error('Your PHP installation does not support XML');
                    
19}
                    
166
                    
167		$parser = xml_parser_create($this->xmlrpc_defencoding);
                    
168		$parser_object = new XML_RPC_Message("filler");
                    
178		xml_set_object($parser, $parser_object);
                    
179		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
                    
180		xml_set_element_handler($parser, 'open_tag', 'closing_tag');
                    
                
kml_infos.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 187 lines
                    
1<?php
                    
2/**
                    
40		$ret = lire_fichier($chemin,$donnees);
                    
41		$arbre = spip_xml_parse($donnees);
                    
42		spip_xml_match_nodes(",^Document,",$arbre, $documents);
                    
132		$ret = lire_fichier($chemin,$donnees);
                    
133		$arbre = spip_xml_parse($donnees);
                    
134		spip_xml_match_nodes(",^metadata,",$arbre, $metadatas);
                    
                
svp_phraser.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 326 lines
                    
1<?php
                    
2
                    
91	if (preg_match(_SVP_REGEXP_BALISE_DEPOT, $xml, $matches)) {
                    
92		if (is_array($arbre_depot = spip_xml_parse($matches[1]))) {
                    
93			$infos['depot'] = svp_aplatir_balises($balises_depot, $arbre_depot, 'nonvide', $infos['depot']);
                    
240			$multis = array();
                    
241			if (is_array($arbre = spip_xml_parse($matches[1])))
                    
242				$multis = svp_aplatir_balises($balises_multis, $arbre);
                    
261	$zip = array();
                    
262	if (is_array($arbre = spip_xml_parse($contenu)))
                    
263		$zip = svp_aplatir_balises($balises_zip, $arbre);
                    
273	$traductions = array();
                    
274	if (is_array($arbre = spip_xml_parse($contenu))) {
                    
275		foreach ($arbre as $_tag => $_langues) {
                    
                
Message.php https://gitlab.com/wuhang2003/typecho | PHP | 167 lines
                    
1<?php
                    
2/*
                    
5   Site:   http://scripts.incutio.com/xmlrpc/
                    
6   Manual: http://scripts.incutio.com/xmlrpc/manual.php
                    
7   Made available under the Artistic License: http://www.opensource.org/licenses/artistic-license.php
                    
40        }
                    
41        $this->_parser = xml_parser_create();
                    
42        // Set XML parser to take the case of tags in to account
                    
42        // Set XML parser to take the case of tags in to account
                    
43        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
                    
44        // Set XML parser callback functions
                    
47        xml_set_character_data_handler($this->_parser, 'cdata');
                    
48        if (!xml_parse($this->_parser, $this->message)) {
                    
49            /* die(sprintf('XML error: %s at line %d',
                    
53        }
                    
54        xml_parser_free($this->_parser);
                    
55        // Grab the error messages, if any
                    
                
ARC2_LegacyXMLParser.php https://github.com/rinie/TransFormr.git | PHP | 315 lines
                    
1<?php
                    
2/*
                    
63      }
                    
64      if (!xml_parse($this->xml_parser, $d, false)) {
                    
65        $error_str = xml_error_string(xml_get_error_code($this->xml_parser));
                    
65        $error_str = xml_error_string(xml_get_error_code($this->xml_parser));
                    
66        $line = xml_get_current_line_number($this->xml_parser);
                    
67        if (!$iso_fallback && preg_match("/Invalid character/i", $error_str)) {
                    
67        if (!$iso_fallback && preg_match("/Invalid character/i", $error_str)) {
                    
68          xml_parser_free($this->xml_parser);
                    
69          unset($this->xml_parser);
                    
83    $this->target_encoding = xml_parser_get_option($this->xml_parser, XML_OPTION_TARGET_ENCODING);
                    
84    xml_parser_free($this->xml_parser);
                    
85    $this->reader->closeStream();
                    
194  
                    
195  function updateNode($node) {/* php4-save */
                    
196    $this->nodes[$node['id']] = $node;
                    
                
bug32001.php https://github.com/tstarling/hiphop-php.git | PHP | 156 lines
                    
1<?php
                    
2class testcase {
                    
89
                    
90		$parser = xml_parser_create(NULL);
                    
91		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
95		if ($this->chunk_size == 0) {
                    
96			$success = @xml_parse($parser, $data, true);
                    
97		} else {
                    
99					$offset += $this->chunk_size) {
                    
100				$success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false);
                    
101				if (!$success) {
                    
105			if ($success) {
                    
106				$success = @xml_parse($parser, "", true);
                    
107			}
                    
                
defines.inc.php https://gitlab.com/A.Julien/sendstockbymail-module-prestashop | PHP | 218 lines
                    
1<?php
                    
2/**
                    
9* It is also available through the world-wide-web at this URL:
                    
10* http://opensource.org/licenses/osl-3.0.php
                    
11* If you did not receive a copy of the license and are unable to
                    
22*  @copyright  2007-2016 PrestaShop SA
                    
23*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
24*  International Registered Trademark & Property of PrestaShop SA
                    
46
                    
47if (!defined('PHP_VERSION_ID')) {
                    
48    $version = explode('.', PHP_VERSION);
                    
48    $version = explode('.', PHP_VERSION);
                    
49    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
                    
50}
                    
109}
                    
110define('_PS_PEAR_XML_PARSER_PATH_',  _PS_TOOL_DIR_.'pear_xml_parser/');
                    
111define('_PS_SWIFT_DIR_',             _PS_TOOL_DIR_.'swift/');
                    
                
gc_xmlparser.php https://gitlab.com/endomorphosis/reservationtelco | PHP | 202 lines
                    
1<?php
                    
2/**
                    
21  
                    
22  For more info: http://code.google.com/p/google-checkout-php-sample-code/
                    
23
                    
30
                    
31/* This uses SAX parser to convert XML data into PHP associative arrays
                    
32 * When invoking the constructor with the input data, strip out the first XML line 
                    
91    function gc_xmlparser($input, $xmlParams=array(XML_OPTION_CASE_FOLDING => 0)) {
                    
92      $xmlp = xml_parser_create();
                    
93      foreach($xmlParams as $opt => $optVal) {
                    
100        }
                    
101        xml_parser_set_option($xmlp, $opt, $optVal);
                    
102      }
                    
103      
                    
104      if(xml_parse_into_struct($xmlp, $input, $vals, $index)) {
                    
105        $this->root = $this->_foldCase($vals[0]['tag']);
                    
                
google_xml.php https://github.com/GreyTeardrop/socionicasys-forum.git | PHP | 247 lines
                    
6* @copyright (c) 2006 - 2009 www.phpbb-seo.com
                    
7* @license http://opensource.org/osi3.0/licenses/lgpl-license.php GNU Lesser General Public License
                    
8*
                    
10// First basic security
                    
11if ( !defined('IN_PHPBB') ) {
                    
12	exit;
                    
45		);
                    
46		$this->module_config['xml_parse'] = (boolean) ($this->module_config['google_randomize'] || $this->module_config['google_unique'] || $this->module_config['google_force_limit'] || $this->module_config['google_force_lastmod']|| $this->module_config['google_check_robots']);
                    
47		// Check cache
                    
60	function init_url_settings() {
                    
61		global $phpbb_seo;
                    
62		// vars will fell like rain in the code ;)
                    
62		// vars will fell like rain in the code ;)
                    
63		$this->url_settings['google_xml_delim'] = !empty($phpbb_seo->seo_delim['google_xml']) ? $phpbb_seo->seo_delim['google_xml'] : '-';
                    
64		$this->url_settings['google_xml_static'] = !empty($phpbb_seo->seo_static['google_xml']) ? $phpbb_seo->seo_static['google_xml'] : 'xml';
                    
                
dataimport.php https://github.com/mterenzio/FollowThis.git | PHP | 298 lines
                    
1<?php
                    
2
                    
5	 *
                    
6	 * $Id: dataimport.php,v 1.11 2007/01/22 16:33:01 soranzo Exp $
                    
7	 */
                    
12	// Include application functions
                    
13	include_once('./libraries/lib.inc.php');
                    
14
                    
258				case 'xml':
                    
259					$parser = xml_parser_create();
                    
260					xml_set_element_handler($parser, '_startElement', '_endElement');
                    
264						$line = fgets($fd, 4096);
                    
265						xml_parse($parser, $line);
                    
266					}
                    
267					
                    
268					xml_parser_free($parser);
                    
269					break;
                    
                
JpegMetadataExtractor.php https://github.com/ChuguluGames/mediawiki-svn.git | PHP | 241 lines
                    
1<?php
                    
2/**
                    
26	static function segmentSplitter ( $filename ) {
                    
27		$showXMP = function_exists( 'xml_parser_create_ns' );
                    
28
                    
105					// Just need to find out what the byte order is.
                    
106					// because php's exif plugin sucks...
                    
107					// This is a II for little Endian, MM for big. Not a unicode BOM.
                    
                
Xliff.php https://github.com/Exercise/zf2.git | PHP | 230 lines
                    
1<?php
                    
2/**
                    
78        $this->_target = $locale;
                    
79        $this->_file   = xml_parser_create($encoding);
                    
80        xml_set_object($this->_file, $this);
                    
80        xml_set_object($this->_file, $this);
                    
81        xml_parser_set_option($this->_file, XML_OPTION_CASE_FOLDING, 0);
                    
82        xml_set_element_handler($this->_file, "_startElement", "_endElement");
                    
84
                    
85        if (!xml_parse($this->_file, file_get_contents($filename))) {
                    
86            $ex = sprintf('XML error: %s at line %d',
                    
88                          xml_get_current_line_number($this->_file));
                    
89            xml_parser_free($this->_file);
                    
90            throw new Translator\Exception($ex);
                    
                
spip_xml_parse.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 114 lines
                    
1<?php
                    
2
                    
2
                    
3	$test = 'spip_xml_parse';
                    
4	require '../test.inc';
                    
6	function seralize_parse($texte){
                    
7		return serialize(spip_xml_parse($texte));
                    
8	}
                    
12<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
                    
13<url><loc>http://localhost/_core/spip/spip.php?breve25</loc>
                    
14<lastmod>2003-12-31</lastmod>
                    
17<url>
                    
18<loc>http://localhost/_core/spip/spip.php?breve32</loc>
                    
19<lastmod>2004-02-10</lastmod>
                    
29$tree1 = <<<tree1
                    
30a:1:{s:57:"urlset xmlns="http://www.google.com/schemas/sitemap/0.84"";a:1:{i:0;a:1:{s:3:"url";a:3:{i:0;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve25";}s:7:"lastmod";a:1:{i:0;s:10:"2003-12-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:1;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve32";}s:7:"lastmod";a:1:{i:0;s:10:"2004-02-10";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:2;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve64";}s:7:"lastmod";a:1:{i:0;s:10:"2005-01-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}}}}}
                    
31tree1;
                    
                
Xliff.php https://bitbucket.org/Ebozavrik/test-application.git | PHP | 238 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Xliff.php 24649 2012-02-26 03:37:54Z adamlundrigan $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
66        if (!is_readable($filename)) {
                    
67            require_once 'Zend/Translate/Exception.php';
                    
68            throw new Zend_Translate_Exception( 'Translation file \'' . $filename . '\' is not readable.' );
                    
78        $this->_target = $locale;
                    
79        $this->_file   = xml_parser_create($encoding);
                    
80        xml_set_object($this->_file, $this);
                    
                
ParserDictionary.php https://bitbucket.org/valmy/openx.git | PHP | 241 lines
                    
1<?php
                    
2// +----------------------------------------------------------------------+
                    
2// +----------------------------------------------------------------------+
                    
3// | PHP versions 4 and 5                                                 |
                    
4// +----------------------------------------------------------------------+
                    
9// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB  |
                    
10// | API as well as database abstraction for PHP applications.            |
                    
11// | This LICENSE is in the BSD license style.                            |
                    
41// +----------------------------------------------------------------------+
                    
42// | Author: Christian Dickmann <dickmann@php.net>                        |
                    
43// +----------------------------------------------------------------------+
                    
47
                    
48require_once 'XML/Parser.php';
                    
49require_once 'MDB2/Schema/Validate.php';
                    
77    {
                    
78        // force ISO-8859-1 due to different defaults for PHP4 and PHP5
                    
79        // todo: this probably needs to be investigated some more andcleaned up
                    
                
Rest.php https://bitbucket.org/acidel/buykoala.git | PHP | 366 lines
                    
1<?php
                    
2/**
                    
9 * It is also available through the world-wide-web at this URL:
                    
10 * http://opensource.org/licenses/osl-3.0.php
                    
11 * If you did not receive a copy of the license and are unable to
                    
23 * @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
                    
24 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
25 */
                    
53     * XML parser
                    
54     * @var Mage_Xml_Parser
                    
55     */
                    
115     *
                    
116     * @return Mage_Xml_Parser
                    
117     */
                    
120        if(is_null($this->_parser)) {
                    
121            $this->_parser = new Mage_Xml_Parser();
                    
122        }
                    
                
Factory.php https://github.com/sgtcarneiro/horde.git | PHP | 154 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
10 * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
                    
11 * @link     http://pear.horde.org/index.php?package=Kolab_Format
                    
12 */
                    
26 * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
                    
27 * @link     http://pear.horde.org/index.php?package=Kolab_Format
                    
28 */
                    
81                $instance = new $class(
                    
82                    new Horde_Kolab_Format_Xml_Parser(
                    
83                        new DOMDocument('1.0', 'UTF-8')
                    
                
sax.php https://github.com/denisbz/SPIP-1.git | PHP | 292 lines
                    
122// http://doc.spip.org/@xml_parsestring
                    
123function xml_parsestring($phraseur, $data)
                    
124{
                    
168	// charger la DTD et transcoder les entites,
                    
169	// et escamoter le doctype que sax mange en php5 mais pas en  php4
                    
170	if (!$doctype) {
                    
193
                    
194	$xml_parser = xml_parser_create($GLOBALS['meta']['charset']);
                    
195
                    
208
                    
209	xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
                    
210
                    
215	$phraseur->phraserTout($xml_parser, $page);
                    
216	xml_parser_free($xml_parser);
                    
217	$phraseur->sax = '';
                    
                
Parser.php https://github.com/strangerstudios/paid-memberships-pro.git | PHP | 140 lines
                    
1<?php
                    
2namespace Braintree\Xml;
                    
84    /**
                    
85     * Converts a node to a PHP value
                    
86     *
                    
139}
                    
140class_alias('Braintree\Xml\Parser', 'Braintree_Xml_Parser');
                    
141
                    
                
Xmlrpcs.php https://github.com/holsinger/openfloor.git | PHP | 503 lines
                    
1<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 4.3.2 or newer
                    
6 *
                    
15
                    
16if ( ! function_exists('xml_parser_create'))
                    
17{	
                    
17{	
                    
18	show_error('Your PHP installation does not support XML');
                    
19}
                    
157		
                    
158		$parser = xml_parser_create($this->xmlrpc_defencoding);
                    
159		$parser_object = new XML_RPC_Message("filler");
                    
169		xml_set_object($parser, $parser_object);
                    
170		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
                    
171		xml_set_element_handler($parser, 'open_tag', 'closing_tag');
                    
                
RSS.php https://github.com/drobbins/s3db.git | PHP | 359 lines
                    
1<?php
                    
2// vim: set expandtab tabstop=4 shiftwidth=4 fdm=marker:
                    
3// +----------------------------------------------------------------------+
                    
4// | PHP Version 4                                                        |
                    
5// +----------------------------------------------------------------------+
                    
5// +----------------------------------------------------------------------+
                    
6// | Copyright (c) 1997-2003 The PHP Group                                |
                    
7// +----------------------------------------------------------------------+
                    
7// +----------------------------------------------------------------------+
                    
8// | This source file is subject to version 2.02 of the PHP license,      |
                    
9// | that is bundled with this package in the file LICENSE, and is        |
                    
10// | available at through the world-wide-web at                           |
                    
11// | http://www.php.net/license/2_02.txt.                                 |
                    
12// | If you did not receive a copy of the PHP license and are unable to   |
                    
13// | obtain it through the world-wide-web, please send a note to          |
                    
14// | license@php.net so we can mail you a copy immediately.               |
                    
15// +----------------------------------------------------------------------+
                    
                
restore_includes.php https://github.com/kpike/moodle.git | PHP | 97 lines
                    
1<?php
                    
2
                    
30// Include all the backup needed stuff
                    
31require_once($CFG->dirroot . '/backup/util/interfaces/checksumable.class.php');
                    
32require_once($CFG->dirroot . '/backup/util/interfaces/loggable.class.php');
                    
32require_once($CFG->dirroot . '/backup/util/interfaces/loggable.class.php');
                    
33require_once($CFG->dirroot . '/backup/util/interfaces/executable.class.php');
                    
34require_once($CFG->dirroot . '/backup/util/interfaces/processable.class.php');
                    
34require_once($CFG->dirroot . '/backup/util/interfaces/processable.class.php');
                    
35require_once($CFG->dirroot . '/backup/backup.class.php');
                    
36require_once($CFG->dirroot . '/backup/util/structure/restore_path_element.class.php');
                    
36require_once($CFG->dirroot . '/backup/util/structure/restore_path_element.class.php');
                    
37require_once($CFG->dirroot . '/backup/util/helper/backup_file_manager.class.php');
                    
38require_once($CFG->dirroot . '/backup/util/helper/restore_prechecks_helper.class.php');
                    
38require_once($CFG->dirroot . '/backup/util/helper/restore_prechecks_helper.class.php');
                    
39require_once($CFG->dirroot . '/backup/util/helper/restore_moodlexml_parser_processor.class.php');
                    
40require_once($CFG->dirroot . '/backup/util/helper/restore_inforef_parser_processor.class.php');
                    
                
Document.php https://gitlab.com/Japang-Jawara/jawara-penilaian | PHP | 404 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * @package php-svg-lib
                    
4 * @link    http://github.com/PhenX/php-svg-lib
                    
64    protected function initParser() {
                    
65        $parser = xml_parser_create("utf-8");
                    
66        xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
                    
109
                    
110        $parser = xml_parser_create("utf-8");
                    
111        xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
                    
125        while ($line = fread($fp, 8192)) {
                    
126            xml_parse($parser, $line, false);
                    
127
                    
132
                    
133        xml_parser_free($parser);
                    
134
                    
                
LinkPoint.php https://github.com/pear/Payment_Process2.git | PHP | 188 lines
                    
1<?php
                    
2require_once 'Payment/Process2/Result.php';
                    
2require_once 'Payment/Process2/Result.php';
                    
3require_once 'Payment/Process2/Result/Driver.php';
                    
4
                    
92
                    
93        $xml =  new Payment_Process2_LinkPoint_XML_Parser();
                    
94        $xml->parseString('<response>'.$this->_rawResponse.'</response>');
                    
117
                    
118require_once 'XML/Parser.php';
                    
119
                    
120/**
                    
121 * Payment_Process2_LinkPoint_XML_Parser
                    
122 *
                    
128 */
                    
129class Payment_Process2_LinkPoint_XML_Parser extends XML_Parser
                    
130{
                    
                
XMLParser.php https://bitbucket.org/Nemcio/kloxo-mr.git | PHP | 261 lines
                    
1<?php
                    
2/**
                    
10 * the PHP License and are unable to obtain it through the web, please
                    
11 * send a note to license@php.net so we can mail you a copy immediately.
                    
12 *
                    
14 * @package    PEAR
                    
15 * @author     Greg Beaver <cellog@php.net>
                    
16 * @author     Stephan Schmidt (original XML_Unserializer code)
                    
17 * @copyright  1997-2006 The PHP Group
                    
18 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
19 * @version    CVS: $Id: XMLParser.php,v 1.1.1.1 2009/05/08 18:30:19 root Exp $
                    
30 * @copyright  1997-2006 The PHP Group
                    
31 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
32 * @version    Release: 1.4.9
                    
112        }
                    
113        xml_parser_free($xp);
                    
114        return true;
                    
                
Tmx.php https://bitbucket.org/areeves42/openfisma.git | PHP | 233 lines
                    
1<?php
                    
2/**
                    
23/** Zend_Locale */
                    
24// require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27// require_once 'Zend/Translate/Adapter.php';
                    
28
                    
60        if (!is_readable($filename)) {
                    
61            // require_once 'Zend/Translate/Exception.php';
                    
62            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
69        $encoding = $this->_findEncoding($filename);
                    
70        $this->_file = xml_parser_create($encoding);
                    
71        xml_set_object($this->_file, $this);
                    
71        xml_set_object($this->_file, $this);
                    
72        xml_parser_set_option($this->_file, XML_OPTION_CASE_FOLDING, 0);
                    
73        xml_set_element_handler($this->_file, "_startElement", "_endElement");
                    
                
xmldocument.php https://github.com/eosc/EosC-2.3.git | PHP | 302 lines
                    
1<?php
                    
2/*
                    
2/*
                    
3    $Id: xmldocument.php,v 1.5 2003/06/27 01:03:03 torinwalker Exp $
                    
4    
                    
228    function destruct(){
                    
229        xml_parser_free($this->xp);
                    
230    }
                    
274    function parse($xmlString) {
                    
275        if(!($this->xp = @xml_parser_create())) {
                    
276            $this->error['description'] = 'Could not create xml parser';
                    
292        } 
                    
293        xml_parser_set_option($this->xp, XML_OPTION_CASE_FOLDING, false);
                    
294        if (!$this->hasErrors()) {
                    
294        if (!$this->hasErrors()) {
                    
295            if(!@xml_parse($this->xp, $xmlString)) {
                    
296                $this->error['description'] = xml_error_string(xml_get_error_code($this->xp));
                    
                
modsxmlsenayan.inc.php https://gitlab.com/mucill/sman7 | PHP | 224 lines
                    
1<?php
                    
2/**
                    
24
                    
25define('MODS_XML_PARSE_ERROR', 199);
                    
26
                    
55      } catch (Exception $xmlerr) {
                    
56          return MODS_XML_PARSE_ERROR;
                    
57          // die($xmlerr->getMessage());
                    
                
Simple.php https://gitlab.com/LisovyiEvhenii/ismextensions | PHP | 326 lines
                    
46 * @version   CVS: $Id: Simple.php,v 1.7 2008/08/24 21:48:21 ashnazg Exp $
                    
47 * @link      http://pear.php.net/package/XML_Parser
                    
48 */
                    
61 *
                    
62 * XML_Parser_Simple allows you to just implement one callback
                    
63 * for each tag that will receive the tag with its attributes
                    
68 *
                    
69 * class myParser extends XML_Parser_Simple
                    
70 * {
                    
93 * @version   Release: @package_version@
                    
94 * @link      http://pear.php.net/package/XML_Parser
                    
95 */
                    
95 */
                    
96class XML_Parser_Simple extends XML_Parser
                    
97{
                    
                
XMPTest.php https://github.com/ChuguluGames/mediawiki-svn.git | PHP | 154 lines
                    
1<?php
                    
2class XMPTest extends MediaWikiTestCase {
                    
13	public function testXMPParse( $xmp, $expected, $info ) {
                    
14		if ( !function_exists( 'xml_parser_create_ns' ) ) {
                    
15			$this->markIncomplete( 'Requires libxml to do XMP parsing' );
                    
30		// with the actual file having .xmp on the end for the xmp
                    
31		// and .result.php on the end for a php file containing the result
                    
32		// array. Second argument is some info on what's being tested.
                    
58			$result = null;
                    
59			include( $xmpPath . $file[0] . '.result.php' );
                    
60			$data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] );
                    
                
import_1_3.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 197 lines
                    
1<?php
                    
2
                    
18	static $tables = '';
                    
19	static $phpmyadmin, $fin;
                    
20	static $field_desc = array ();
                    
28		if (!$tables) return  ($import_ok = false);
                    
29		$phpmyadmin = preg_match("{^phpmyadmin::}is",
                    
30			$GLOBALS['meta']['restauration_version_archive'])
                    
39	if (strpos($table,'=')!==FALSE) {
                    
40		list($table, $attl) = xml_parse_tag($table);
                    
41		$atts = array_merge($atts, $attl);
                    
68				     $gz,
                    
69				     $phpmyadmin,
                    
70				     '/' . $table,
                    
184			if ($phpmyadmin)
                    
185				$value = str_replace($phpmyadmin[0],$phpmyadmin[1],$value);
                    
186			elseif ($dir_img) {
                    
                
XML.php https://bitbucket.org/blackriver/openx.git | PHP | 251 lines
                    
1<?php
                    
2// +----------------------------------------------------------------------+
                    
2// +----------------------------------------------------------------------+
                    
3// | PHP Version 4                                                        |
                    
4// +----------------------------------------------------------------------+
                    
4// +----------------------------------------------------------------------+
                    
5// | Copyright (c) 1997-2003 The PHP Group                                |
                    
6// +----------------------------------------------------------------------+
                    
6// +----------------------------------------------------------------------+
                    
7// | This source file is subject to version 2.0 of the PHP license,       |
                    
8// | that is bundled with this package in the file LICENSE, and is        |
                    
9// | available at through the world-wide-web at                           |
                    
10// | http://www.php.net/license/2_02.txt.                                 |
                    
11// | If you did not receive a copy of the PHP license and are unable to   |
                    
12// | obtain it through the world-wide-web, please send a note to          |
                    
13// | license@php.net so we can mail you a copy immediately.               |
                    
14// +----------------------------------------------------------------------+
                    
                
Qt.php https://github.com/ayamyau/concrete5.git | PHP | 160 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Qt.php 23775 2011-03-01 17:25:24Z ralph $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
62        if (!is_readable($filename)) {
                    
63            require_once 'Zend/Translate/Exception.php';
                    
64            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
69        $encoding = $this->_findEncoding($filename);
                    
70        $this->_file = xml_parser_create($encoding);
                    
71        xml_set_object($this->_file, $this);
                    
                
function.xml-set-external-entity-ref-handler.html https://bitbucket.org/thncr/manuals.git | HTML | 161 lines
                    
11 <div class="up"><a href="ref.xml.html">XML 解析器函数</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="function.xml-set-external-entity-ref-handler" class="refentry">
                    
15    <h1 class="refname">xml_set_external_entity_ref_handler</h1>
                    
16    <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">xml_set_external_entity_ref_handler</span> &mdash; <span class="dc-title">建立外部实体指向处理器</span></p>
                    
17
                    
159 <div class="up"><a href="ref.xml.html">XML 解析器函数</a></div>
                    
160 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
161</div></body></html>
                    
                
Xml.class.php http://sqltoappledictionary.googlecode.com/svn/trunk/ | PHP | 377 lines
                    
1<?php
                    
2
                    
295		Xml::$build = Xml::createDocument();
                    
296		$xml_parser = xml_parser_create();
                    
297		xml_set_element_handler($xml_parser, isset(Xml::$__start_element_handler) ? Xml::$__start_element_handler: array("Xml", "__start_element_handler"), isset(Xml::$__end_element_handler) ? Xml::$__end_element_handler: array("Xml", "__end_element_handler"));
                    
297		xml_set_element_handler($xml_parser, isset(Xml::$__start_element_handler) ? Xml::$__start_element_handler: array("Xml", "__start_element_handler"), isset(Xml::$__end_element_handler) ? Xml::$__end_element_handler: array("Xml", "__end_element_handler"));
                    
298		xml_set_character_data_handler($xml_parser, isset(Xml::$__character_data_handler) ? Xml::$__character_data_handler: array("Xml", "__character_data_handler"));
                    
299		xml_set_default_handler($xml_parser, isset(Xml::$__default_handler) ? Xml::$__default_handler: array("Xml", "__default_handler"));
                    
299		xml_set_default_handler($xml_parser, isset(Xml::$__default_handler) ? Xml::$__default_handler: array("Xml", "__default_handler"));
                    
300		xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
                    
301		xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0);
                    
305		}
                    
306		if(1 !== xml_parse($xml_parser, $str, true)) {
                    
307			throw new HException("Xml parse error (" . ((xml_error_string(xml_get_error_code($xml_parser)) . ") line #") . xml_get_current_line_number($xml_parser)));
                    
308		}
                    
309		xml_parser_free($xml_parser);
                    
310		if($isComplete) {
                    
                
StreamTest.php https://github.com/sgtcarneiro/horde.git | PHP | 125 lines
                    
1<?php
                    
2/**
                    
11 * @category   Horde
                    
12 * @license    http://opensource.org/licenses/bsd-license.php BSD
                    
13 * @package    Log
                    
20 * @category   Horde
                    
21 * @license    http://opensource.org/licenses/bsd-license.php BSD
                    
22 * @package    Log
                    
24 */
                    
25class Horde_Log_Handler_StreamTest extends PHPUnit_Framework_TestCase
                    
26{
                    
33    {
                    
34        $resource = xml_parser_create();
                    
35        try {
                    
41        }
                    
42        xml_parser_free($resource);
                    
43    }
                    
                
example.xml-map-tags.html https://bitbucket.org/stillzhl/manuals.git | HTML | 37 lines
                    
11 <div class="up"><a href="xml.examples.html">范例</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="example.xml-map-tags" class="section">
                    
24<div class="phpcode"><code><span style="color: #000000">
                    
25<span style="color: #0000BB">&lt;?php<br />$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"data.xml"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$map_array&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"BOLD"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"B"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"EMPHASIS"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"I"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"LITERAL"&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"TT"<br /></span><span style="color: #007700">);<br /><br />function&nbsp;</span><span style="color: #0000BB">startElement</span><span style="color: #007700">(</span><span style="color: #0000BB">$parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$attrs</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]</span><span style="color: #DD0000">&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">endElement</span><span style="color: #007700">(</span><span style="color: #0000BB">$parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/</span><span style="color: #0000BB">$map_array</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]</span><span style="color: #DD0000">&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">characterData</span><span style="color: #007700">(</span><span style="color: #0000BB">$parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$xml_parser&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xml_parser_create</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">//&nbsp;use&nbsp;case-folding&nbsp;so&nbsp;we&nbsp;are&nbsp;sure&nbsp;to&nbsp;find&nbsp;the&nbsp;tag&nbsp;in&nbsp;$map_array<br /></span><span style="color: #0000BB">xml_parser_set_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">XML_OPTION_CASE_FOLDING</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">xml_set_element_handler</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"startElement"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"endElement"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">xml_set_character_data_handler</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"characterData"</span><span style="color: #007700">);<br />if&nbsp;(!(</span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"r"</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #DD0000">"could&nbsp;not&nbsp;open&nbsp;XML&nbsp;input"</span><span style="color: #007700">);<br />}<br /><br />while&nbsp;(</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">4096</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">xml_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">feof</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">"XML&nbsp;error:&nbsp;%s&nbsp;at&nbsp;line&nbsp;%d"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">xml_error_string</span><span style="color: #007700">(</span><span style="color: #0000BB">xml_get_error_code</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">)),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">xml_get_current_line_number</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">xml_parser_free</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
                    
26</span>
                    
35 <div class="up"><a href="xml.examples.html">范例</a></div>
                    
36 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
37</div></body></html>
                    
                
Qt.php https://github.com/Doap/iCms---intelligent-Content-management-system.git | PHP | 160 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Qt.php 20096 2010-01-06 02:05:09Z bkarwin $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
62        if (!is_readable($filename)) {
                    
63            require_once 'Zend/Translate/Exception.php';
                    
64            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
69        $encoding = $this->_findEncoding($filename);
                    
70        $this->_file = xml_parser_create($encoding);
                    
71        xml_set_object($this->_file, $this);
                    
                
backup_general_helper.class.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 305 lines
                    
1<?php
                    
2
                    
31 *
                    
32 * TODO: Finish phpdocs
                    
33 */
                    
127        $xmlparser->set_file($moodlefile);
                    
128        $xmlprocessor = new restore_moodlexml_parser_processor();
                    
129        $xmlparser->set_processor($xmlprocessor);
                    
281        global $CFG;
                    
282        require_once($CFG->dirroot . '/backup/util/helper/convert_helper.class.php');
                    
283
                    
                
XMLParser.php https://github.com/axxtel/agilebill.git | PHP | 261 lines
                    
1<?php
                    
2/**
                    
10 * the PHP License and are unable to obtain it through the web, please
                    
11 * send a note to license@php.net so we can mail you a copy immediately.
                    
12 *
                    
14 * @package    PEAR
                    
15 * @author     Greg Beaver <cellog@php.net>
                    
16 * @author     Stephan Schmidt (original XML_Unserializer code)
                    
17 * @copyright  1997-2008 The PHP Group
                    
18 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
19 * @version    CVS: $Id: XMLParser.php,v 1.13 2008/01/03 20:26:36 cellog Exp $
                    
30 * @copyright  1997-2008 The PHP Group
                    
31 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
32 * @version    Release: 1.7.2
                    
112        }
                    
113        xml_parser_free($xp);
                    
114        return true;
                    
                
XMLParser.php https://bitbucket.org/shashwat_dinasource/bitscentral.git | PHP | 261 lines
                    
1<?php
                    
2/**
                    
10 * the PHP License and are unable to obtain it through the web, please
                    
11 * send a note to license@php.net so we can mail you a copy immediately.
                    
12 *
                    
14 * @package    PEAR
                    
15 * @author     Greg Beaver <cellog@php.net>
                    
16 * @author     Stephan Schmidt (original XML_Unserializer code)
                    
17 * @copyright  1997-2006 The PHP Group
                    
18 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
19 * @version    CVS: $Id: XMLParser.php,v 1.11 2006/01/06 04:47:36 cellog Exp $
                    
30 * @copyright  1997-2006 The PHP Group
                    
31 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
                    
32 * @version    Release: 1.4.11
                    
112        }
                    
113        xml_parser_free($xp);
                    
114        return true;
                    
                
updates-product.php https://bitbucket.org/blackriver/openx.git | PHP | 186 lines
                    
31// Required files
                    
32require_once MAX_PATH . '/www/admin/config.php';
                    
33require_once MAX_PATH . '/www/admin/lib-maintenance.inc.php';
                    
33require_once MAX_PATH . '/www/admin/lib-maintenance.inc.php';
                    
34require_once MAX_PATH . '/lib/OA/Sync.php';
                    
35
                    
58$current .= $strRunningOn.' '.str_replace('/', '&nbsp;', ereg_replace(" .*$", '', $_SERVER["SERVER_SOFTWARE"])).', ';
                    
59$current .= 'PHP&nbsp;'.phpversion().' '.$strAndPlain.' '.phpAds_dbmsname;
                    
60
                    
70if (!isset($session['maint_update'])) {
                    
71    if (function_exists('xml_parser_create')) {
                    
72        // Show wait please text with rotating logo
                    
86        phpAds_SessionDataRegister('maint_update', $res);
                    
87        phpAds_SessionDataStore();
                    
88
                    
                
SimpleXML.php https://bitbucket.org/amitholkar/zenfile-18-05.git | PHP | 260 lines
                    
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2
                    
4// This class provides an alternative implementation of the SimpleXML API
                    
5// that works under PHP 4, so applications that need to run under environments
                    
6// on which only PHP 4 is available can take advantage of the SimpleXML API benefit
                    
8// the original class was created by Taha Paksu
                    
9// http://www.phpclasses.org/browse/package/4484.html
                    
10
                    
19	var $skip_empty_values = false;
                    
20	var $php_errormsg;
                    
21	var $evalCode="";
                    
22        
                    
23        function xml_parse($data){
                    
24                $php_errormsg="";
                    
28            	$encoding = 'UTF-8';
                    
29		$parser = xml_parser_create($encoding);
                    
30		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
                
Parser.php https://github.com/wokkie/sitellite.git | PHP | 238 lines
                    
1<?php
                    
2
                    
27	function parse ($schema) {
                    
28		$this->parser = xml_parser_create ($this->encoding);
                    
29		if (! $this->parser) {
                    
32		}
                    
33		if (! xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, false)) {
                    
34			xml_parser_free ($this->parser);
                    
48
                    
49		if (xml_parse_into_struct ($this->parser, $schema, $this->nodes, $this->tags)) {
                    
50			xml_parser_free ($this->parser);
                    
60			$this->error = 'Relax Error: ' . xml_error_string ($this->err_code);
                    
61			xml_parser_free ($this->parser);
                    
62			return false;
                    
                
class_simplexml.php https://github.com/Smokki/PsychoStats-extended.git | PHP | 305 lines
                    
1<?php
                    
2/*
                    
2/*
                    
3	Class from phpclasses.org:
                    
4	http://www.phpclasses.org/browse/package/4484.html
                    
16	var $skip_empty_values = false;
                    
17	var $php_errormsg;
                    
18	var $evalCode="";
                    
256	{
                    
257		$php_errormsg="";
                    
258		$this->result="";
                    
261		$data = file_get_contents($file);
                    
262		if (!$data) return 'Cannot open xml document: ' . (isset($php_errormsg) ? $php_errormsg : $file);
                    
263		return $this->xml_load_string($data, $resulttype, $encoding);
                    
266	function xml_load_string($data, $resulttype = 'object', $encoding = 'UTF-8') {
                    
267		$parser = xml_parser_create($encoding);
                    
268		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
                
php-xmlparser.el https://gitlab.com/_njdm/emacs.d | Emacs Lisp | 194 lines
                    
22;; More see file:///usr/share/doc/php-doc/html/function.xml-parse-into-struct.html
                    
23;; http://php.net/manual/en/book.xml.php
                    
24
                    
66
                    
67(define-skeleton php-xml_parse
                    
68  "Insert a xml_parse"
                    
88
                    
89(define-skeleton php-xml_parser_free
                    
90  "Insert a xml_parser_free statement."
                    
95
                    
96(define-skeleton php-xml_parser_get_option
                    
97  "Insert a xml_parser_get_option statement."
                    
103
                    
104(define-skeleton php-xml_parser_set_option
                    
105  "Insert a xml_parser_set_option statement."
                    
                
ref.sdo-das-xml.html https://bitbucket.org/stillzhl/manuals.git | HTML | 436 lines
                    
11 <div class="up"><a href="book.sdo-das-xml.html">SDO DAS XML</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="ref.sdo-das-xml" class="reference">
                    
167    <h2 class="title">
                    
168     <strong class="classname">SDO_DAS_XML_ParserException</strong>
                    
169    </h2>
                    
197    With Java SDO, this mapping is implemented by the XMLHelper.
                    
198    With SDO for PHP, this mapping is implemented by the
                    
199    XML Data Access Service.
                    
209      Simple Type with sdoJava:instanceClass
                    
210      - no PHP equivalent provided.
                    
211     </p>
                    
215      Simple Type with sdoJava:extendedInstanceClass
                    
216      - no PHP equivalent provided.
                    
217     </p>
                    
                
CliDumperTest.php https://gitlab.com/codegod/evricommunity | PHP | 501 lines
                    
1<?php
                    
2
                    
20 */
                    
21class CliDumperTest extends \PHPUnit_Framework_TestCase
                    
22{
                    
26    {
                    
27        require __DIR__.'/Fixtures/dumb-var.php';
                    
28
                    
28
                    
29        $dumper = new CliDumper('php://output');
                    
30        $dumper->setColors(false);
                    
44        $out = preg_replace('/[ \t]+$/m', '', $out);
                    
45        $intMax = PHP_INT_MAX;
                    
46        $res = (int) $var['res'];
                    
114    {
                    
115        $var = xml_parser_create();
                    
116
                    
                
lighthouse.php https://github.com/codebase/MoPCMS2.0.git | PHP | 219 lines
                    
86	 * xml2array() will convert the given XML text to an array in the XML structure.
                    
87	 * Link: http://www.bin-co.com/php/scripts/xml2array/
                    
88	 * Arguments : $contents - The XML text
                    
98
                    
99	    if(!function_exists('xml_parser_create')) {
                    
100	        //print "'xml_parser_create()' function not found!";
                    
103
                    
104	    //Get the XML parser of PHP - PHP must have this module for the parser to work
                    
105	    $parser = xml_parser_create('');
                    
105	    $parser = xml_parser_create('');
                    
106	    xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
                    
107	    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
107	    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
108	    xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
                    
109	    xml_parse_into_struct($parser, trim($contents), $xml_values);
                    
                
XmlToAppData.php https://github.com/1989gaurav/Propel.git | PHP | 404 lines
                    
1<?php
                    
2
                    
10
                    
11require_once dirname(__FILE__) . '/../../model/AppData.php';
                    
12require_once dirname(__FILE__) . '/../../exception/SchemaException.php';
                    
15 * A class that is used to parse an input xml schema file and creates an AppData
                    
16 * PHP object.
                    
17 *
                    
58	 * @param      PropelPlatformInterface $defaultPlatform The default database platform for the application.
                    
59	 * @param      string $defaultPackage the default PHP package used for the om
                    
60	 * @param      string $encoding The database encoding.
                    
114
                    
115		$parser = xml_parser_create();
                    
116		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
118		xml_set_element_handler($parser, 'startElement', 'endElement');
                    
119		if (!xml_parse($parser, $xmlString)) {
                    
120			throw new Exception(sprintf("XML error: %s at line %d",
                    
                
Tbx.php https://github.com/jiiarra/site.git | PHP | 179 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Tbx.php 16971 2009-07-22 18:05:45Z mikaelkael $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
47     * Generates the tbx adapter
                    
48     * This adapter reads with php's xml_parser
                    
49     *
                    
73        if (!is_readable($filename)) {
                    
74            require_once 'Zend/Translate/Exception.php';
                    
75            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
                
index.php https://bitbucket.org/dereckson/phpldapadmin.git | PHP | 147 lines
                    
49if (! extension_loaded('pcre'))
                    
50	die('<p>Your install of PHP appears to be missing PCRE support.</p><p>Please install PCRE support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>');
                    
51
                    
61if (! extension_loaded('session'))
                    
62	error('<p>Your install of PHP appears to be missing php-session support.</p><p>Please install php-session support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>','error',null,true);
                    
63
                    
67		'title'=>_('Missing required extension'),
                    
68		'body'=>'Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
                    
69		'type'=>'error'));
                    
74		'title'=>_('Missing required extension'),
                    
75		'body'=>'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
                    
76		'type'=>'error'));
                    
81		'title'=>_('Missing required extension'),
                    
82		'body'=>'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
                    
83		'type'=>'error'));
                    
                
update.php https://github.com/chalosalvador/GDS.git | PHP | 297 lines
                    
1<?php
                    
2/**
                    
114	 */
                    
115	protected $_xml_parser;
                    
116
                    
279
                    
280		$this->xml_parser = xml_parser_create('');
                    
281		xml_set_object($this->xml_parser, $this);
                    
281		xml_set_object($this->xml_parser, $this);
                    
282		xml_set_element_handler($this->xml_parser, '_startElement', '_endElement');
                    
283		xml_set_character_data_handler($this->xml_parser, '_characterData');
                    
286		{
                    
287			if (!xml_parse($this->xml_parser, $data, feof($fp)))
                    
288			{
                    
293		}
                    
294		xml_parser_free($this->xml_parser);
                    
295		return true;
                    
                
setup.php https://github.com/bernard357/yacs.git | PHP | 353 lines
                    
95		// provide instructions
                    
96		Logger::error(sprintf(i18n::s('ERROR: YACS requires at least PHP version 5.3. The server runs version %s.'), phpversion()));
                    
97
                    
114
                    
115		$context['text'] .= '<p class="details"><a href="setup.php">'.i18n::s('Check the MySQL PHP extension again')."</a></p>\n";
                    
116
                    
134
                    
135		$context['text'] .= '<p class="details"><a href="setup.php">'.i18n::s('Check the XML PHP extension again')."</a></p>\n";
                    
136
                    
151		$context['text'] .= '<p>'.i18n::s('WARNING: You will not be able to upload zip files.')."</p>\n";
                    
152		$context['text'] .= '<p class="details"><a href="setup.php">'.i18n::s('Check the ZIP PHP extension again')."</a></p>\n";
                    
153
                    
312	// if there is no index at the upper level
                    
313	if(!file_exists($context['path_to_root'].'../index.php') && ($content = Safe::file_get_contents($context['path_to_root'].'index.php'))) {
                    
314
                    
                
progressive_parser.class.php https://github.com/kpike/moodle.git | PHP | 283 lines
                    
55
                    
56    protected $xml_parser; // PHP's low level XML SAX parser
                    
57    protected $file;       // full path to file being progressively parsed | => mutually exclusive
                    
70    public function __construct($case_folding = false) {
                    
71        $this->xml_parser = xml_parser_create('UTF-8');
                    
72        xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, $case_folding);
                    
130        }
                    
131        if (is_null($this->xml_parser)) {
                    
132            throw new progressive_parser_exception('progressive_parser_already_used');
                    
142        }
                    
143        xml_parser_free($this->xml_parser);
                    
144        $this->xml_parser = null;
                    
157    protected function parse($data, $eof) {
                    
158        if (!xml_parse($this->xml_parser, $data, $eof)) {
                    
159            throw new progressive_parser_exception(
                    
                
Tbx.php https://github.com/rogerwu99/randomizr.git | PHP | 179 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Date.php 2498 2006-12-23 22:13:38Z thomas $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
47     * Generates the tbx adapter
                    
48     * This adapter reads with php's xml_parser
                    
49     *
                    
73        if (!is_readable($filename)) {
                    
74            require_once 'Zend/Translate/Exception.php';
                    
75            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
                
fam2po.php https://github.com/CircleCode/Dynacase-tutorial-zoo.git | PHP | 294 lines
                    
1<?php
                    
2
                    
131    global $rows;
                    
132    $xml_parser = xml_parser_create();
                    
133    // Utilisons la gestion de casse, de maniere a etre surs de trouver la balise dans $map_array
                    
133    // Utilisons la gestion de casse, de maniere a etre surs de trouver la balise dans $map_array
                    
134    xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
                    
135    xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0);
                    
135    xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0);
                    
136    xml_set_element_handler($xml_parser, "startElement", "endElement");
                    
137    xml_set_character_data_handler($xml_parser, "characterData");
                    
138
                    
139    if (!xml_parse($xml_parser, $xmlcontent)) {
                    
140        $err = sprintf("error XML : %s line %d",
                    
144    } else {
                    
145        xml_parser_free($xml_parser);
                    
146        //print_r($rows);
                    
                
xfire.php https://github.com/CMDcentral/CoManD.git | PHP | 418 lines
                    
1<?php
                    
2
                    
338			$this->xml_storage[ $this->username ][ $this->type ][ "no" ] = 0;
                    
339			$this->read_xml = xml_parser_create();
                    
340			xml_set_object( $this->read_xml, $this );
                    
342			xml_set_character_data_handler( $this->read_xml, "XML_CharData" ); 
                    
343			xml_parse( $this->read_xml, file_get_contents( "cache/" . $this->username . "_" . $type . ".xml" ) );
                    
344			xml_parser_free( $this->read_xml ); 
                    
                
main.php https://github.com/MyITCRM/myitcrm1.git | PHP | 387 lines
                    
1<?php
                    
2####################################################
                    
11####################################################
                    
12if(!xml2php("parts")) {
                    
13	$smarty->assign('error_msg',"Error in language file");
                    
169	/* parse Return */
                    
170	$parser = xml_parser_create();
                    
171   xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
171   xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
172   xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
                    
173   xml_parse_into_struct($parser, $content, $values, $tags);
                    
173   xml_parse_into_struct($parser, $content, $values, $tags);
                    
174   xml_parser_free($parser);
                    
175	
                    
307
                    
308				$parser = xml_parser_create();
                    
309				xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
                
geo_simple.php https://github.com/minoura/GeoSimple-Plugin.git | PHP | 149 lines
                    
1<?php
                    
2// 携帯ライブラリ
                    
2// 携帯ライブラリ
                    
3require_once(VENDORS.'ecw'.DS.'lib3gk.php');
                    
4
                    
67		// リンクを分解
                    
68		$parser = xml_parser_create();
                    
69		if(!xml_parse_into_struct($parser, $htmlLink, $vals, $index) || empty($vals)){
                    
71		}
                    
72		xml_parser_free($parser);
                    
73		
                    
                
acp_k_version_check.php https://github.com/dravekx/stargate-portal.git | PHP | 204 lines
                    
6* @copyright (c) 2007 StarTrekGuide
                    
7* @license http://opensource.org/licenses/gpl-license.php GNU Public License
                    
8*
                    
12*/
                    
13if (!defined('IN_PHPBB'))
                    
14{
                    
27		global $user, $template;
                    
28		global $phpbb_admin_path, $phpEx;
                    
29
                    
49			{
                    
50				include($phpbb_root_path . $mod_directory . $file . $phpEx);
                    
51
                    
127
                    
128				'U_AUTHOR'			=> 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $var['author'],
                    
129			));
                    
                
Parser.php https://github.com/kjavitz/SalesIgniter1.git | PHP | 240 lines
                    
1<?php
                    
2
                    
9 * which accompanies this distribution, and is available at
                    
10 * http://www.opensource.org/licenses/eclipse-1.0.php
                    
11 * 
                    
11 * 
                    
12 * This is intended as a simple alternative to the PHP SimpleXML or DOM 
                    
13 * extensions (some of the machines I'm working on don't have the SimpleXML 
                    
25 */
                    
26QuickBooks_Loader::load('/QuickBooks/XML.php');
                    
27
                    
30 */
                    
31QuickBooks_Loader::load('/QuickBooks/XML/Node.php');
                    
32
                    
35 */
                    
36QuickBooks_Loader::load('/QuickBooks/XML/Document.php');
                    
37
                    
                
extension.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 232 lines
                    
1<?php
                    
2/**
                    
189
                    
190		$this->xmlParser = xml_parser_create('');
                    
191		xml_set_object($this->xmlParser, $this);
                    
194
                    
195		if (!xml_parse($this->xmlParser, $response->body))
                    
196		{
                    
201		}
                    
202		xml_parser_free($this->xmlParser);
                    
203		if (isset($this->latest))
                    
                
Parser.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 407 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * A PHP-Based RSS and Atom Feed Framework.
                    
6 * Takes the hard work out of managing a complete RSS/Atom solution.
                    
41 * @link http://simplepie.org/ SimplePie
                    
42 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
                    
43 */
                    
136		{
                    
137			$parser_check = xml_parser_create();
                    
138			xml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);
                    
138			xml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);
                    
139			xml_parser_free($parser_check);
                    
140			$xml_is_sane = isset($values[0]['value']);
                    
145		{
                    
146			$xml = xml_parser_create_ns($this->encoding, $this->separator);
                    
147			xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
                    
                
Log.php https://github.com/bermi/akelos.git | PHP | 125 lines
                    
1<?php
                    
2/* vim: set expandtab tabstop=4 shiftwidth=4: */
                    
3// +----------------------------------------------------------------------+
                    
4// | PHP version 5                                                        |
                    
5// +----------------------------------------------------------------------+
                    
9// | This LICENSE is in the BSD license style.                            |
                    
10// | http://www.opensource.org/licenses/bsd-license.php                   |
                    
11// |                                                                      |
                    
43//
                    
44// $Id: Log.php 42 2004-04-26 09:39:59Z clay $
                    
45//
                    
53/**
                    
54 * VersionControl_SVN_Log allows for XML formatted output. XML_Parser is used to 
                    
55 * manipulate that output.
                    
56 */
                    
57require_once 'XML/Parser.php';
                    
58
                    
                
Xml.hx https://github.com/steshaw/haxe-compiler-experiments.git | Haxe | 405 lines
                    
81		build = createDocument();
                    
82		var xml_parser = untyped __call__("xml_parser_create");
                    
83		untyped __call__("xml_set_element_handler", xml_parser, __start_element_handler, __end_element_handler);
                    
83		untyped __call__("xml_set_element_handler", xml_parser, __start_element_handler, __end_element_handler);
                    
84		untyped __call__("xml_set_character_data_handler", xml_parser, __character_data_handler);
                    
85		untyped __call__("xml_set_default_handler", xml_parser, __default_handler);
                    
85		untyped __call__("xml_set_default_handler", xml_parser, __default_handler);
                    
86		untyped __call__("xml_parser_set_option", xml_parser, __php__("XML_OPTION_CASE_FOLDING"), 0);
                    
87		untyped __call__("xml_parser_set_option", xml_parser, __php__("XML_OPTION_SKIP_WHITE"), 0);
                    
93
                    
94		if(1 != untyped __call__("xml_parse", xml_parser, str, true)) {
                    
95			throw "Xml parse error ("+untyped __call__("xml_error_string", __call__("xml_get_error_code", xml_parser)) + ") line #" + __call__("xml_get_current_line_number", xml_parser);
                    
97
                    
98		untyped __call__("xml_parser_free", xml_parser);
                    
99
                    
                
lib.xml.php https://github.com/cpg-contrib/coppermine.git | PHP | 347 lines
                    
1<?php
                    
2/*************************
                    
13  Coppermine version: 1.5.0
                    
14  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/include/lib.xml.php $
                    
15  $Revision: 5129 $
                    
18  ********************************************
                    
19  Code below has been taken from lib.xml.php and slightly modified for use with coppermine
                    
20  Orginal: http://www.phpclasses.org/browse/file/17412.html
                    
49 * @copyright 2007 ENDERLIN Ivan.
                    
50 * @since PHP4
                    
51 * @version 0.3
                    
120    $this->pOut = array();
                    
121    $this->parser = xml_parser_create();
                    
122
                    
122
                    
123    xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
                    
124    xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $encoding);
                    
                
Simple.php https://github.com/SEA-DEVELOPMENT/4900.git | PHP | 326 lines
                    
46 * @version   CVS: $Id: Simple.php,v 1.2 2010/12/14 17:36:07 moodlerobot Exp $
                    
47 * @link      http://pear.php.net/package/XML_Parser
                    
48 */
                    
61 *
                    
62 * XML_Parser_Simple allows you to just implement one callback
                    
63 * for each tag that will receive the tag with its attributes
                    
68 *
                    
69 * class myParser extends XML_Parser_Simple
                    
70 * {
                    
93 * @version   Release: @package_version@
                    
94 * @link      http://pear.php.net/package/XML_Parser
                    
95 */
                    
95 */
                    
96class XML_Parser_Simple extends XML_Parser
                    
97{
                    
                
update.php https://github.com/rietn/minima.git | PHP | 180 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * @version		$Id: update.php 20196 2011-01-09 02:40:25Z ian $
                    
4 * @package		Joomla.Framework
                    
6 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
                    
7 * @license		GNU General Public License, see LICENSE.php
                    
8 */
                    
162
                    
163		$this->xml_parser = xml_parser_create('');
                    
164		xml_set_object($this->xml_parser, $this);
                    
169		{
                    
170			if (!xml_parse($this->xml_parser, $data, feof($fp)))
                    
171			{
                    
176		}
                    
177		xml_parser_free($this->xml_parser);
                    
178		return true;
                    
                
utils.php https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests | PHP | 365 lines
                    
1<?php
                    
2
                    
126// convert valid xml to an array tree structure
                    
127// kinda lame but it works with a default php 4 install
                    
128class testXMLParser {
                    
132	function testXMLParser($in) {
                    
133		$this->xml = xml_parser_create();
                    
134		xml_set_object($this->xml, $this);
                    
134		xml_set_object($this->xml, $this);
                    
135		xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
                    
136		xml_set_element_handler($this->xml, array(&$this, 'startHandler'), array(&$this, 'endHandler'));
                    
141	function parse($in) {
                    
142		$parse = xml_parse($this->xml, $in, sizeof($in));
                    
143		if (!$parse) {
                    
146			xml_get_current_line_number($this->xml)), E_USER_ERROR);
                    
147			xml_parser_free($this->xml);
                    
148		}
                    
                
libxml.constants.html https://bitbucket.org/thncr/manuals.git | HTML | 347 lines
                    
11 <div class="up"><a href="book.libxml.html">libxml</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="libxml.constants" class="appendix">
                    
15
                    
16 <p class="simpara">下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
                    
17 <dl>
                    
221   <span class="term">
                    
222    <strong><code>LIBXML_PARSEHUGE</code></strong>
                    
223     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
                    
227    <span class="simpara">
                    
228     Sets XML_PARSE_HUGE flag, which relaxes any hardcoded limit from the parser. This affects 
                    
229     limits like maximum depth of a document or the entity recursion, as well as limits of the 
                    
233     <p class="para">
                    
234      Only available in Libxml &gt;= 2.7.0 (as of PHP &gt;= 5.3.2 and PHP &gt;= 5.2.12)
                    
235     </p>
                    
                
CliDumperTest.php https://gitlab.com/dzakiafif/cokelatklasik | PHP | 353 lines
                    
1<?php
                    
2
                    
24    {
                    
25        require __DIR__.'/Fixtures/dumb-var.php';
                    
26
                    
26
                    
27        $dumper = new CliDumper('php://output');
                    
28        $dumper->setColors(false);
                    
42        $out = preg_replace('/[ \t]+$/m', '', $out);
                    
43        $intMax = PHP_INT_MAX;
                    
44        $res1 = (int) $var['res'];
                    
47
                    
48        if (PHP_VERSION_ID >= 50400) {
                    
49            $closure54 = <<<EOTXT
                    
124
                    
125        $var = xml_parser_create();
                    
126
                    
                
EbatNs_ResponseParser.php https://gitlab.com/endomorphosis/KindSupply | PHP | 490 lines
                    
1<?php 
                    
2// $Id: EbatNs_ResponseParser.php,v 1.1 2007/05/31 11:38:00 michael Exp $
                    
2// $Id: EbatNs_ResponseParser.php,v 1.1 2007/05/31 11:38:00 michael Exp $
                    
3/* $Log: EbatNs_ResponseParser.php,v $
                    
4/* Revision 1.1  2007/05/31 11:38:00  michael
                    
115				$typeFileName = basename($typeName);
                    
116				require_once $typeFileName . '.php';
                    
117			}
                    
174
                    
175            $parser = xml_parser_create($encoding);
                    
176            xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
180            
                    
181            if (!xml_parse($parser, $messageText, true)) {
                    
182                $errMsg = sprintf('XML error on line %d col %d byte %d %s',
                    
192            }
                    
193            xml_parser_free($parser);
                    
194            
                    
                
_parse_lockinfo.php https://github.com/ibnoe/Microweber.git | PHP | 251 lines
                    
1<?php // $Id: _parse_lockinfo.php 246152 2007-11-14 10:49:27Z hholzgra $
                    
2/*
                    
107        // create namespace aware parser
                    
108        $xml_parser = xml_parser_create_ns("UTF-8", " ");
                    
109
                    
117        // we want a case sensitive parser
                    
118        xml_parser_set_option($xml_parser,
                    
119                              XML_OPTION_CASE_FOLDING, false);
                    
125                $had_input = true;
                    
126                $this->success &= xml_parse($xml_parser, $line, false);
                    
127            }
                    
131        if ($had_input) {
                    
132            $this->success &= xml_parse($xml_parser, "", true);
                    
133        }
                    
139        // free parser resource
                    
140        xml_parser_free($xml_parser);
                    
141
                    
                
atomlib.php https://bitbucket.org/jstroschein/wordpress-3.5.1-clean.git | PHP | 352 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * Atom Syndication Format PHP Library
                    
4 *
                    
5 * @package AtomLib
                    
6 * @link http://code.google.com/p/phpatomlib/
                    
7 *
                    
84
                    
85    var $FILE = "php://input";
                    
86
                    
113
                    
114        $parser = xml_parser_create_ns();
                    
115        xml_set_object($parser, $this);
                    
116        xml_set_element_handler($parser, "start_element", "end_element");
                    
117        xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
                    
118        xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0);
                    
                
wpml-config.php https://gitlab.com/mostafame/team_website | PHP | 378 lines
                    
1<?php
                    
2
                    
6 * the language switcher configuration is not interpreted
                    
7 * the xml parser has been adapted from http://php.net/manual/en/function.xml-parse-into-struct.php#84261
                    
8 * many thanks to wickedfather at hotmail dot com
                    
47	 */
                    
48	protected function xml_parse( $xml, $context ) {
                    
49		$parser = xml_parser_create();
                    
49		$parser = xml_parser_create();
                    
50		xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
                    
51		xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
                    
51		xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
                    
52		xml_parse_into_struct( $parser, $xml, $this->values );
                    
53		xml_parser_free( $parser );
                    
55		$this->index = 0;
                    
56		$arr = $this->xml_parse_recursive();
                    
57		$arr = $arr['wpml-config'];
                    
                
Rest.php https://github.com/speedupmate/Magento-CE-Mirror.git | PHP | 387 lines
                    
1<?php
                    
2/**
                    
9 * It is also available through the world-wide-web at this URL:
                    
10 * http://opensource.org/licenses/osl-3.0.php
                    
11 * If you did not receive a copy of the license and are unable to
                    
23 * @copyright  Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
                    
24 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
                    
25 */
                    
54     *
                    
55     * @var Mage_Xml_Parser
                    
56     */
                    
123     *
                    
124     * @return Mage_Xml_Parser
                    
125     */
                    
128        if (is_null($this->_parser)) {
                    
129            $this->_parser = new Mage_Xml_Parser();
                    
130        }
                    
                
aioseop_performance.php https://gitlab.com/vanafroo/landingpage | PHP | 324 lines
                    
1<?php
                    
2/**
                    
202			if ( is_callable( 'exif_read_data' ) ) {
                    
203				$exif = __( 'Yes', 'all-in-one-seo-pack' ) . ' ( V' . $this->substr( phpversion( 'exif' ), 0, 4 ) . ')';
                    
204			} else {
                    
211			}
                    
212			if ( is_callable( 'xml_parser_create' ) ) {
                    
213				$xml = __( 'Yes', 'all-in-one-seo-pack' );
                    
235			$debug_info                   = array(
                    
236				__( 'Operating System', 'all-in-one-seo-pack' )            => PHP_OS,
                    
237				__( 'Server', 'all-in-one-seo-pack' )                      => $_SERVER['SERVER_SOFTWARE'],
                    
240				__( 'SQL Mode', 'all-in-one-seo-pack' )                    => $sql_mode,
                    
241				__( 'PHP Version', 'all-in-one-seo-pack' )                 => PHP_VERSION,
                    
242				__( 'PHP Allow URL fopen', 'all-in-one-seo-pack' )         => $allow_url_fopen,
                    
242				__( 'PHP Allow URL fopen', 'all-in-one-seo-pack' )         => $allow_url_fopen,
                    
243				__( 'PHP Memory Limit', 'all-in-one-seo-pack' )            => $memory_limit,
                    
244				__( 'PHP Max Upload Size', 'all-in-one-seo-pack' )         => $upload_max,
                    
                
wpml-config.php https://gitlab.com/Pibolo/plugin-wordpress.git | PHP | 341 lines
                    
1<?php
                    
2
                    
6 * the language switcher configuration is not interpreted
                    
7 * the xml parser has been adapted from http://php.net/manual/en/function.xml-parse-into-struct.php#84261
                    
8 * many thanks to wickedfather at hotmail dot com
                    
47	 */
                    
48	protected function xml_parse($xml, $context) {
                    
49		$parser = xml_parser_create();
                    
49		$parser = xml_parser_create();
                    
50		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                    
51		xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
                    
51		xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
                    
52		xml_parse_into_struct($parser, $xml, $this->values);
                    
53		xml_parser_free($parser);
                    
55		$this->index = 0;
                    
56		$arr = $this->xml_parse_recursive();
                    
57		$arr = $arr['wpml-config'];
                    
                
onyx-rss.php https://bitbucket.org/antonyravel/cape-resorts.git | PHP | 381 lines
                    
1<?php
                    
2
                    
22   define('ONYX_RSS_VERS', '1.0');
                    
23   define('ONYX_ERR_NO_PARSER', '<a href="http://www.php.net/manual/en/ref.xml.php">PHP\'s XML Extension</a> is not loaded or available.');
                    
24   define('ONYX_ERR_NOT_WRITEABLE', 'The specified cache directory is not writeable.');
                    
46   /* For when PHP v.5 is released
                    
47    * http://www.phpvolcano.com/eide/php5.php?page=variables
                    
48    * private $parser;
                    
60   // Forward compatibility with PHP v.5
                    
61   // http://www.phpvolcano.com/eide/php5.php?page=start
                    
62   function __construct()
                    
71
                    
72      if (!function_exists('xml_parser_create'))
                    
73      {
                    
360
                    
361         $req = "HEAD $path HTTP/1.1\r\nUser-Agent: PHP/".phpversion();
                    
362         $req.= "\r\nHost: $host\r\nAccept: */*\r\n\r\n";
                    
                
XMLToArray.php https://github.com/orchestra-io/sample-openx.git | PHP | 128 lines
                    
1<?php
                    
2/*
                    
28 * A custom XML parser facility from 
                    
29 * http://www.devarticles.com/c/a/PHP/Converting-XML-Into-a-PHP-Data-Structure/
                    
30 */
                    
55        // set up a new XML parser to do all the work for us
                    
56        $this->parser = xml_parser_create();
                    
57        xml_set_object($this->parser, $this);
                    
57        xml_set_object($this->parser, $this);
                    
58        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);
                    
59        xml_set_element_handler($this->parser, "startElement", "endElement");
                    
66        // parse the data and free the parser...
                    
67        xml_parse($this->parser, $xmlstring);
                    
68        xml_parser_free($this->parser);
                    
                
validate.class.php https://github.com/gakaki/fml-api-php.git | PHP | 281 lines
                    
4 * *******************************************************************************
                    
5 * 许可声明:专为《细说PHP》读者及LAMP兄弟连学员提供的“学习型”超轻量级php框架。*
                    
6 * *******************************************************************************
                    
75				//创建XML解析器
                    
76				$xml_parser = xml_parser_create();
                    
77
                    
78				//使用大小写折叠来保证能在元素数组中找到这些元素名称
                    
79				xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
                    
80				xml_set_element_handler ($xml_parser, array(__CLASS__,"start"),array(__CLASS__, "end"));
                    
89					//循环地读入XML文档,只到文档的EOF,同时停止解析
                    
90					if (!xml_parse($xml_parser, $data, feof($fp)))
                    
91					{
                    
110				//关闭XML解析器指针,释放资源
                    
111				xml_parser_free($xml_parser);
                    
112				return self::$flag;
                    
                
spipmotion_mediainfo.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 202 lines
                    
1<?php 
                    
2/**
                    
28		include_spip('inc/xml');
                    
29		$arbre = spip_xml_parse($metadatas);
                    
30		spip_xml_match_nodes(",^track type,",$arbre, $tracks);
                    
                
ext_xml.h https://github.com/kevlund/hiphop-php.git | C Header | 56 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
5   | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com)         |
                    
6   | Copyright (c) 1997-2010 The PHP Group                                |
                    
7   +----------------------------------------------------------------------+
                    
7   +----------------------------------------------------------------------+
                    
8   | This source file is subject to version 3.01 of the PHP license,      |
                    
9   | that is bundled with this package in the file LICENSE, and is        |
                    
10   | available through the world-wide-web at the following url:           |
                    
11   | http://www.php.net/license/3_01.txt                                  |
                    
12   | If you did not receive a copy of the PHP license and are unable to   |
                    
13   | obtain it through the world-wide-web, please send a note to          |
                    
14   | license@php.net so we can mail you a copy immediately.               |
                    
15   +----------------------------------------------------------------------+
                    
                
releaseInfoTest.php https://bitbucket.org/IshaDakota/programdb.git | PHP | 87 lines
                    
1<?php
                    
2
                    
37    );
                    
38    $release = updatexml_parse_release($request_data, $xml);
                    
39    $this->assertEquals($release['version'], '6.x-1.18');
                    
47    );
                    
48    $release = updatexml_parse_release($request_data, $xml);
                    
49    $this->assertEquals($release['version'], '6.x-2.1');
                    
56    );
                    
57    $release = updatexml_parse_release($request_data, $xml);
                    
58    $this->assertEquals($release['version'], '6.x-1.23');
                    
65    );
                    
66    $release = updatexml_parse_release($request_data, $xml);
                    
67    // 6.x-2.2 is skipped because it is unpublished.
                    
76    );
                    
77    $release = updatexml_parse_release($request_data, $xml);
                    
78    $this->assertEquals($release['version'], '6.x-1.x-dev');
                    
                
example.xml-structure.html https://bitbucket.org/thncr/manuals.git | HTML | 33 lines
                    
11 <div class="up"><a href="xml.examples.html">范例</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="example.xml-structure" class="section">
                    
20<div class="phpcode"><code><span style="color: #000000">
                    
21<span style="color: #0000BB">&lt;?php<br />$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"data.xml"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$depth&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /><br />function&nbsp;</span><span style="color: #0000BB">startElement</span><span style="color: #007700">(</span><span style="color: #0000BB">$parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$attrs</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;</span><span style="color: #0000BB">$depth</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">$depth</span><span style="color: #007700">[</span><span style="color: #0000BB">$parser</span><span style="color: #007700">];&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&nbsp;&nbsp;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$name</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$depth</span><span style="color: #007700">[</span><span style="color: #0000BB">$parser</span><span style="color: #007700">]++;<br />}<br /><br />function&nbsp;</span><span style="color: #0000BB">endElement</span><span style="color: #007700">(</span><span style="color: #0000BB">$parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;global&nbsp;</span><span style="color: #0000BB">$depth</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$depth</span><span style="color: #007700">[</span><span style="color: #0000BB">$parser</span><span style="color: #007700">]--;<br />}<br /><br /></span><span style="color: #0000BB">$xml_parser&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">xml_parser_create</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">xml_set_element_handler</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"startElement"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"endElement"</span><span style="color: #007700">);<br />if&nbsp;(!(</span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"r"</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #DD0000">"could&nbsp;not&nbsp;open&nbsp;XML&nbsp;input"</span><span style="color: #007700">);<br />}<br /><br />while&nbsp;(</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">4096</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">xml_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">feof</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">"XML&nbsp;error:&nbsp;%s&nbsp;at&nbsp;line&nbsp;%d"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">xml_error_string</span><span style="color: #007700">(</span><span style="color: #0000BB">xml_get_error_code</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">)),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">xml_get_current_line_number</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">xml_parser_free</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml_parser</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
                    
22</span>
                    
31 <div class="up"><a href="xml.examples.html">范例</a></div>
                    
32 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
33</div></body></html>
                    
                
Tmx.php https://github.com/Martin1982/IBMessagingWorkshopServer.git | PHP | 207 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Tmx.php 20096 2010-01-06 02:05:09Z bkarwin $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24// require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27// require_once 'Zend/Translate/Adapter.php';
                    
28
                    
58        if (!is_readable($filename)) {
                    
59            // require_once 'Zend/Translate/Exception.php';
                    
60            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
63        $encoding = $this->_findEncoding($filename);
                    
64        $this->_file = xml_parser_create($encoding);
                    
65        xml_set_object($this->_file, $this);
                    
                
Tbx.php https://gitlab.com/rsilveira1987/Expresso | PHP | 179 lines
                    
1<?php
                    
2/**
                    
17 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
                    
18 * @version    $Id: Tbx.php 10020 2009-08-18 14:34:09Z j.fischer@metaways.de $
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
23/** Zend_Locale */
                    
24require_once 'Zend/Locale.php';
                    
25
                    
26/** Zend_Translate_Adapter */
                    
27require_once 'Zend/Translate/Adapter.php';
                    
28
                    
47     * Generates the tbx adapter
                    
48     * This adapter reads with php's xml_parser
                    
49     *
                    
73        if (!is_readable($filename)) {
                    
74            require_once 'Zend/Translate/Exception.php';
                    
75            throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.');
                    
                
_parse_proppatch.php https://github.com/ibnoe/Microweber.git | PHP | 237 lines
                    
1<?php // $Id: _parse_proppatch.php 246152 2007-11-14 10:49:27Z hholzgra $
                    
2/*
                    
105
                    
106        $xml_parser = xml_parser_create_ns("UTF-8", " ");
                    
107
                    
114
                    
115        xml_parser_set_option($xml_parser,
                    
116                              XML_OPTION_CASE_FOLDING, false);
                    
121                $had_input = true;
                    
122                $this->success &= xml_parse($xml_parser, $line, false);
                    
123            }
                    
126        if($had_input) {
                    
127            $this->success &= xml_parse($xml_parser, "", true);
                    
128        }
                    
129
                    
130        xml_parser_free($xml_parser);
                    
131
                    
                
xml_test.php https://bitbucket.org/jstechnologies/cats.git | PHP | 178 lines
                    
1<?php
                    
2    // $Id: xml_test.php 424 2006-07-21 02:20:17Z will $
                    
2    // $Id: xml_test.php 424 2006-07-21 02:20:17Z will $
                    
3    require_once(dirname(__FILE__) . '/../xml.php');
                    
4    Mock::generate('SimpleScorer');
                    
5
                    
6    if (! function_exists('xml_parser_create')) {
                    
7        SimpleTest::ignore('TestOfXmlStructureParsing');
                    
                
Xml.hx https://github.com/MarcWeber/haxe-compiler-experiments.git | Haxe | 360 lines
                    
67	{
                    
68		return untyped __call__("str_replace", "'", '&apos;', __call__("htmlentities", value, __php__('ENT_COMPAT'), 'UTF-8'));
                    
69	}
                    
100		build = createDocument();
                    
101		var xml_parser = untyped __call__("xml_parser_create");
                    
102		untyped __call__("xml_set_element_handler", xml_parser, __start_element_handler, __end_element_handler);
                    
104		untyped __call__("xml_set_default_handler", xml_parser, __default_handler);
                    
105		untyped __call__("xml_parser_set_option", xml_parser, __php__("XML_OPTION_CASE_FOLDING"), 0);
                    
106		untyped __call__("xml_parser_set_option", xml_parser, __php__("XML_OPTION_SKIP_WHITE"), 0);
                    
112		if(1 != untyped __call__("xml_parse", xml_parser, str, true)) {
                    
113			throw "Xml parse error ("+untyped __call__("xml_error_string", __call__("xml_get_error_code", xml_parser)) + ") line #" + __call__("xml_get_current_line_number", xml_parser);
                    
114		}
                    
115
                    
116		untyped __call__("xml_parser_free", xml_parser);
                    
117
                    
                
Simple.php https://github.com/manoj240375/moodle_edify.git | PHP | 326 lines
                    
46 * @version   CVS: $Id: Simple.php,v 1.1 2009/06/22 18:35:56 stronk7 Exp $
                    
47 * @link      http://pear.php.net/package/XML_Parser
                    
48 */
                    
61 *
                    
62 * XML_Parser_Simple allows you to just implement one callback
                    
63 * for each tag that will receive the tag with its attributes
                    
68 *
                    
69 * class myParser extends XML_Parser_Simple
                    
70 * {
                    
93 * @version   Release: @package_version@
                    
94 * @link      http://pear.php.net/package/XML_Parser
                    
95 */
                    
95 */
                    
96class XML_Parser_Simple extends XML_Parser
                    
97{
                    
                
listeimc_functions.php https://bitbucket.org/pombredanne/spip-zone-treemap.git | PHP | 195 lines
                    
1<?php
                    
2
                    
30                             
                    
31	/*if (!$cities_array = spip_xml_parse($cities_xml))
                    
32	{
                    
41                                         
                    
42	$xml_parse = xml_parser_create("UTF-8");
                    
43	xml_set_element_handler($xml_parse,"cities_debut_element","cities_fin_element");
                    
43	xml_set_element_handler($xml_parse,"cities_debut_element","cities_fin_element");
                    
44	xml_set_character_data_handler($xml_parse,"cities_element");
                    
45
                    
45
                    
46	if (!xml_parse($xml_parse,$cities_xml,false))
                    
47	{
                    
52
                    
53	xml_parser_free($xml_parse);
                    
54        
                    
                
 

Source

Language