コード例 #1
0
ファイル: OpfResource.php プロジェクト: ridibooks/epub
 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);
     }
 }
コード例 #2
0
ファイル: OpfResource.php プロジェクト: jonhargett/epub
 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);
     }
 }