// Structs for parsing X(HT)?ML files in e-pub archives
package main
import (
"encoding/xml"
)
type Head struct {
Title string `xml:"title"`
}
type Paragraph struct {
Text string `xml:",innerxml"`
}
type BlockQuote struct {
Paragraphs []Paragraph `xml:"p"`
}
type Division struct {
Divisions []Division `xml:"div"`
Paragraphs []Paragraph `xml:"p"`
BlockQuotes []BlockQuote `xml:"blockquote"`
}
type Body struct {
Title string `xml:"h3"`
Division Division `xml:"div"`
}
type Xhtml struct {
XMLName xml.Name `xml:"html"`
Head Head `xml:"head"`
Body Body `xml:"body"`
}
type Content struct {
Src string `xml:"src,attr"`
}
type NavPoint struct {
Label string `xml:"navLabel>text"`
Content Content `xml:"content"`
Order int `xml:"playOrder,attr"`
}
type Ncx struct {
XMLName xml.Name `xml:"ncx"`
Title string `xml:"docTitle>text"`
NavPoints []NavPoint `xml:"navMap>navPoint"`
}