From 3737ec0549a7b2d952b7ad8048c01c7de8e173ad Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Sat, 7 May 2022 16:31:03 +0200 Subject: [PATCH] mimetype is attr and path chardata in --- cmd/build.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)