public function __construct($input)
{
if (is_resource($input)) {
rewind($input);
$input = stream_get_contents($input);
}
$this->_document = new DOMDocument('1.0', 'UTF-8');
$this->_document->preserveWhiteSpace = false;
$this->_document->formatOutput = true;
$result = @$this->_document->loadXML($input);
if (!$result || empty($this->_document->documentElement)) {
throw new Horde_Kolab_FreeBusy_Exception('Invalid OWA input!');
}
}