diff --git a/cmd/build.go b/cmd/build.go index 10c641c..bf13960 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -23,8 +23,8 @@ type ZoteroItem struct { XMLName xml.Name `xml:"zoteroItem"` Attachments struct { Attachment []struct { - Path string `xml:"path"` - MimeType string `xml:"mimeType"` + Text string `xml:",chardata"` + MimeType string `xml:"mimeType,attr"` } `xml:"attachment"` } `xml:"attachments"` Date string `xml:"date"` @@ -112,8 +112,9 @@ should be enough for the next successful build).`, if !mimeTypeMap[mimeType] { attachmentsIDs[attachmentID] = true filePath := zAttachment.FindElement("[name()='rdf:resource']").SelectAttr("rdf:resource").Value - itemAttachments.CreateElement("attachment").CreateElement("path").SetText(filePath) - itemAttachments.CreateElement("attachment").CreateElement("mimeType").SetText(mimeType) + attachment := itemAttachments.CreateElement("attachment") + attachment.SetText(filePath) + attachment.CreateAttr("mimeType", mimeType) mimeTypeMap[mimeType] = true } else { fmt.Println("DUPLICATE mimeType:", mimeType, attachmentID)