mimetype is attr and path chardata in <attachment>
This commit is contained in:
parent
55777c078a
commit
3737ec0549
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue