mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
add phpDoc style comment
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10774 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
744cc459ac
commit
3f0dd9cb06
11 changed files with 534 additions and 229 deletions
|
|
@ -1,18 +1,23 @@
|
|||
<?php
|
||||
/**
|
||||
* @class GeneralXmlParser
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Generic XML parser for XE
|
||||
* @version 0.1
|
||||
*/
|
||||
class GeneralXmlParser {
|
||||
/**
|
||||
* GeneralXmlParser class
|
||||
* Generic XML parser for XE
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /classes/xml
|
||||
* @version 0.1
|
||||
*/
|
||||
class GeneralXmlParser {
|
||||
/**
|
||||
* result of parse
|
||||
* @var array
|
||||
*/
|
||||
var $output = array();
|
||||
|
||||
/**
|
||||
* @brief parse a given input to product a object containing parse values.
|
||||
* @param[in] $input data to be parsed
|
||||
* @return Returns an object containing parsed values or NULL in case of failure
|
||||
*/
|
||||
/**
|
||||
* Parse a given input to product a object containing parse values.
|
||||
* @param string $input data to be parsed
|
||||
* @return array|NULL Returns an object containing parsed values or NULL in case of failure
|
||||
*/
|
||||
function parse($input = '') {
|
||||
$oParser = xml_parser_create('UTF-8');
|
||||
xml_set_object($oParser, $this);
|
||||
|
|
@ -28,12 +33,13 @@
|
|||
return $this->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief start element handler
|
||||
* @param[in] $parse an instance of parser
|
||||
* @param[in] $node_name a name of node
|
||||
* @param[in] $attrs attributes to be set
|
||||
*/
|
||||
/**
|
||||
* Start element handler
|
||||
* @param resource $parser an instance of parser
|
||||
* @param string $node_name a name of node
|
||||
* @param array $attrs attributes to be set
|
||||
* @return void
|
||||
*/
|
||||
function _tagOpen($parser, $node_name, $attrs) {
|
||||
$obj->node_name = strtolower($node_name);
|
||||
$obj->attrs = $attrs;
|
||||
|
|
@ -42,23 +48,25 @@
|
|||
array_push($this->output, $obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief character data handler
|
||||
* variable in the last element of this->output
|
||||
* @param[in] $parse an instance of parser
|
||||
* @param[in] $body a data to be added
|
||||
*/
|
||||
/**
|
||||
* Character data handler
|
||||
* Variable in the last element of this->output
|
||||
* @param resource $parse an instance of parser
|
||||
* @param string $body a data to be added
|
||||
* @return void
|
||||
*/
|
||||
function _tagBody($parser, $body) {
|
||||
//if(!trim($body)) return;
|
||||
$this->output[count($this->output)-1]->body .= $body;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief end element handler
|
||||
* @param[in] $parse an instance of parser
|
||||
* @param[in] $node_name name of xml node
|
||||
*/
|
||||
/**
|
||||
* End element handler
|
||||
* @param resource $parse an instance of parser
|
||||
* @param string $node_name name of xml node
|
||||
* @return void
|
||||
*/
|
||||
function _tagClosed($parser, $node_name) {
|
||||
$node_name = strtolower($node_name);
|
||||
$cur_obj = array_pop($this->output);
|
||||
|
|
@ -79,5 +87,5 @@
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue