diff --git a/classes/xml/GeneralXmlParser.class.php b/classes/xml/GeneralXmlParser.class.php
index a4421c28d..bb60c4db0 100644
--- a/classes/xml/GeneralXmlParser.class.php
+++ b/classes/xml/GeneralXmlParser.class.php
@@ -6,7 +6,8 @@
* @package /classes/xml
* @version 0.1
*/
-class GeneralXmlParser {
+class GeneralXmlParser
+{
/**
* result of parse
* @var array
@@ -14,78 +15,86 @@ class GeneralXmlParser {
var $output = array();
/**
- * 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);
- xml_set_element_handler($oParser, "_tagOpen", "_tagClosed");
- xml_set_character_data_handler($oParser, "_tagBody");
+ * 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);
+ xml_set_element_handler($oParser, "_tagOpen", "_tagClosed");
+ xml_set_character_data_handler($oParser, "_tagBody");
- xml_parse($oParser, $input);
- xml_parser_free($oParser);
+ xml_parse($oParser, $input);
+ xml_parser_free($oParser);
- if(!count($this->output)) return;
- $this->output = array_shift($this->output);
+ if(!count($this->output)) return;
+ $this->output = array_shift($this->output);
- return $this->output;
+ return $this->output;
}
/**
- * 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;
- $obj->childNodes = array();
+ * 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;
+ $obj->childNodes = array();
- array_push($this->output, $obj);
+ array_push($this->output, $obj);
}
/**
- * 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;
+ * 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;
}
-
/**
- * 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);
- $parent_obj = &$this->output[count($this->output)-1];
+ * 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);
+ $parent_obj = &$this->output[count($this->output)-1];
- if($parent_obj->childNodes[$node_name])
- {
- $tmp_obj = $parent_obj->childNodes[$node_name];
- if(is_array($tmp_obj)) {
- array_push($parent_obj->childNodes[$node_name], $cur_obj);
- } else {
- $parent_obj->childNodes[$node_name] = array();
- array_push($parent_obj->childNodes[$node_name], $tmp_obj);
- array_push($parent_obj->childNodes[$node_name], $cur_obj);
- }
- } else {
- $parent_obj->childNodes[$node_name] = $cur_obj;
- }
+ if($parent_obj->childNodes[$node_name])
+ {
+ $tmp_obj = $parent_obj->childNodes[$node_name];
+ if(is_array($tmp_obj))
+ {
+ array_push($parent_obj->childNodes[$node_name], $cur_obj);
+ }
+ else
+ {
+ $parent_obj->childNodes[$node_name] = array();
+ array_push($parent_obj->childNodes[$node_name], $tmp_obj);
+ array_push($parent_obj->childNodes[$node_name], $cur_obj);
+ }
+ }
+ else
+ {
+ $parent_obj->childNodes[$node_name] = $cur_obj;
+ }
}
-
}
-?>
+/* End of file GeneralXmlParser.class.php */
+/* Location: ./classes/xml/GeneralXmlParser.class.php */
diff --git a/classes/xml/XmlGenerator.class.php b/classes/xml/XmlGenerator.class.php
index dbe221773..3f5aa3cad 100644
--- a/classes/xml/XmlGenerator.class.php
+++ b/classes/xml/XmlGenerator.class.php
@@ -5,53 +5,70 @@
* @package /classes/xml
* @version 0.1
*/
-class XmlGenerator{
+class XmlGenerator
+{
/**
- * object change to xml
- * @param object $xml
- * @return string
- */
- function obj2xml($xml){
+ * object change to xml
+ * @param object $xml
+ * @return string
+ */
+ function obj2xml($xml)
+ {
$buff = "\n";
- foreach($xml as $nodeName => $nodeItem){
+ foreach($xml as $nodeName => $nodeItem)
+ {
$buff .= $this->_makexml($nodeItem);
}
return $buff;
}
/**
- * object change to xml
- * @param object $node node in xml object
- * @return string
- */
- function _makexml($node){
+ * object change to xml
+ * @param object $node node in xml object
+ * @return string
+ */
+ function _makexml($node)
+ {
$body = '';
- foreach($node as $key => $value){
- switch($key){
+ foreach($node as $key => $value)
+ {
+ switch($key)
+ {
case 'node_name' : break;
- case 'attrs' : {
- $attrs = '';
- if (isset($value)){
- foreach($value as $attrName=>$attrValue){
- $attrs .= sprintf(' %s="%s"', $attrName, htmlspecialchars($attrValue));
- }
- }
- }break;
- case 'body' : $body = $value; break;
- default : {
- if (is_array($value)){
- foreach($value as $idx => $arrNode){
- $body .= $this->_makexml($arrNode);
- }
- }else if(is_object($value)){
- $body = $this->_makexml($value);
- }
- }
+ case 'attrs' :
+ {
+ $attrs = '';
+ if (isset($value))
+ {
+ foreach($value as $attrName=>$attrValue)
+ {
+ $attrs .= sprintf(' %s="%s"', $attrName, htmlspecialchars($attrValue));
+ }
+ }
+ }
+ break;
+ case 'body' :
+ $body = $value;
+ break;
+ default :
+ {
+ if (is_array($value))
+ {
+ foreach($value as $idx => $arrNode)
+ {
+ $body .= $this->_makexml($arrNode);
+ }
+ }
+ else if(is_object($value))
+ {
+ $body = $this->_makexml($value);
+ }
+ }
}
}
return sprintf('<%s%s>%s%s>'."\n", $node->node_name, $attrs, $body, $node->node_name);
}
}
-
-?>
+/* End of file XmlGenerator.class.php */
+/* Location: ./classes/xml/XmlGenerator.class.php */
diff --git a/classes/xml/XmlJsFilter.class.php b/classes/xml/XmlJsFilter.class.php
index 7f1c2190f..542c01855 100644
--- a/classes/xml/XmlJsFilter.class.php
+++ b/classes/xml/XmlJsFilter.class.php
@@ -1,315 +1,335 @@
{
+ *
+ *
+ * "- A form of key = val combination of items to js array return, act required
+ *
+ *
+ * "- Result to get by sending ajax to the server
+ * <- get the result of error name
+ *
+ *
+ * }
+ *
+ * @detail
+ *
{
+ * - syntax description of