// practical as most documents contain these characters. Other text is not
// expected here so recording a parse error is necessary.
$dataTmp =
trim($data, " \t\n\r\f"
);
if (!
empty($dataTmp)) { // fprintf(STDOUT, "Unexpected insert mode: %d", $this->insertMode);
$this->
parseError('Unexpected text. Ignoring: ' .
$dataTmp);
} return;
} // fprintf(STDOUT, "Appending text %s.", $data);
$node =
$this->doc->
createTextNode($data);
$this->current->
appendChild($node);
} public function eof() { // If the $current isn't the $root, do we need to do anything?
} public function parseError($msg,
$line = 0,
$col = 0
) { $this->errors
[] =
sprintf('Line %d, Col %d: %s',
$line,
$col,
$msg);
}