Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 76... Línea 76...
76
     *
76
     *
77
     * @return bool True
77
     * @return bool True
78
     */
78
     */
79
    function initialise() {
79
    function initialise() {
80
        $this->parser = xml_parser_create();
80
        $this->parser = xml_parser_create();
81
        xml_set_object($this->parser, $this);
-
 
Línea 82... Línea 81...
82
 
81
 
83
        xml_set_element_handler($this->parser, "start_element", "end_element");
82
        xml_set_element_handler($this->parser, [$this, "start_element"], [$this, "end_element"]);
Línea 84... Línea 83...
84
        xml_set_character_data_handler($this->parser, "discard_data");
83
        xml_set_character_data_handler($this->parser, [$this, "discard_data"]);
85
 
84
 
86
        $this->tag_number        = 0; // Just a unique ID for each tag
85
        $this->tag_number        = 0; // Just a unique ID for each tag
87
        $this->digest            = '';
86
        $this->digest            = '';
Línea 222... Línea 221...
222
            case 'FAULT':
221
            case 'FAULT':
223
                $handler = 'parse_fault';
222
                $handler = 'parse_fault';
224
            default:
223
            default:
225
                break;
224
                break;
226
        }
225
        }
227
        xml_set_character_data_handler($this->parser, $handler);
226
        xml_set_character_data_handler($this->parser, [$this, $handler]);
228
        return true;
227
        return true;
229
    }
228
    }
Línea 230... Línea 229...
230
 
229
 
231
    /**
230
    /**
Línea 349... Línea 348...
349
     * @param   mixed   $parser The XML parser
348
     * @param   mixed   $parser The XML parser
350
     * @param   string  $name   The name of the tag, e.g. method_call
349
     * @param   string  $name   The name of the tag, e.g. method_call
351
     * @return  bool            True
350
     * @return  bool            True
352
     */
351
     */
353
    function end_element($parser, $name) {
352
    function end_element($parser, $name) {
354
        $ok = xml_set_character_data_handler($this->parser, "discard_data");
353
        $ok = xml_set_character_data_handler($this->parser, [$this, "discard_data"]);
355
        return true;
354
        return true;
356
    }
355
    }
357
}
356
}