/** * Reads the input XML stream and calls appropriate methods when * encountering opening (or empty) tags, closing tags or text * content. When completed, save() is called. */ public function process() { $this->preProcessAction(); while ($this->r->read()) { switch ($this->r->nodeType) { case XMLReader::ELEMENT: $this->nodeOpen(); break; case XMLReader::END_ELEMENT: $this->nodeClose(); break; case XMLReader::TEXT: case XMLReader::SIGNIFICANT_WHITESPACE: $this->nodeContent(); } } $this->r->close(); $this->save(); }