private function processMetadataElement(SimpleXMLElement $xml, Metadata $metadata) { if ($xml->count() === 0) { return; } foreach ($xml->children(NamespaceRegistry::NAMESPACE_DC) as $child) { $item = new MetadataItem(); $item->name = $child->getName(); $item->value = trim((string) $child); $item->attributes = $this->getXmlAttributes($child); $metadata->add($item); } // Xml with no DC namespace. foreach ($xml->children()->meta as $child) { $item = new MetadataItem(); $item->name = (string) $child['name']; $item->value = (string) $child['content']; $item->attributes = array(); $metadata->add($item); } }
private function processMetadataElement(SimpleXMLElement $xml, Metadata $metadata) { foreach ($xml->children(NamespaceRegistry::NAMESPACE_DC) as $child) { $item = new MetadataItem(); $item->name = $child->getName(); $item->value = trim((string) $child); $item->attributes = $this->getXmlAttributes($child); $metadata->add($item); } }