public function __construct(\DOMElement $xml = null)
{
if ($xml === null) {
return;
}
if (!$xml->hasAttribute('xml:lang')) {
throw new \Exception('Missing lang on Keywords.');
}
if (!is_string($xml->textContent) || !strlen($xml->textContent)) {
throw new \Exception('Missing value for Keywords.');
}
$this->Keywords = array();
foreach (explode(' ', $xml->textContent) as $keyword) {
$this->Keywords[] = str_replace('+', ' ', $keyword);
}
$this->lang = $xml->getAttribute('xml:lang');
}