* Parse Metadata * @private * @param {node} xml * @return {object} metadata
(xml)
| 81 | * @return {object} metadata |
| 82 | */ |
| 83 | parseMetadata(xml) { |
| 84 | var metadata = {} |
| 85 | |
| 86 | metadata.title = this.getElementText(xml, 'title') |
| 87 | metadata.creator = this.getElementText(xml, 'creator') |
| 88 | metadata.description = this.getElementText(xml, 'description') |
| 89 | |
| 90 | metadata.pubdate = this.getElementText(xml, 'date') |
| 91 | |
| 92 | metadata.publisher = this.getElementText(xml, 'publisher') |
| 93 | |
| 94 | metadata.identifier = this.getElementText(xml, 'identifier') |
| 95 | metadata.language = this.getElementText(xml, 'language') |
| 96 | metadata.rights = this.getElementText(xml, 'rights') |
| 97 | |
| 98 | metadata.modified_date = this.getPropertyText(xml, 'dcterms:modified') |
| 99 | |
| 100 | metadata.layout = this.getPropertyText(xml, 'rendition:layout') |
| 101 | metadata.orientation = this.getPropertyText(xml, 'rendition:orientation') |
| 102 | metadata.flow = this.getPropertyText(xml, 'rendition:flow') |
| 103 | metadata.viewport = this.getPropertyText(xml, 'rendition:viewport') |
| 104 | metadata.media_active_class = this.getPropertyText( |
| 105 | xml, |
| 106 | 'media:active-class', |
| 107 | ) |
| 108 | metadata.spread = this.getPropertyText(xml, 'rendition:spread') |
| 109 | // metadata.page_prog_dir = packageXml.querySelector("spine").getAttribute("page-progression-direction"); |
| 110 | |
| 111 | return metadata |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Parse Manifest |
no test coverage detected