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"`
|
XMLName xml.Name `xml:"zoteroItem"`
|
||||||
Attachments struct {
|
Attachments struct {
|
||||||
Attachment []struct {
|
Attachment []struct {
|
||||||
Path string `xml:"path"`
|
Text string `xml:",chardata"`
|
||||||
MimeType string `xml:"mimeType"`
|
MimeType string `xml:"mimeType,attr"`
|
||||||
} `xml:"attachment"`
|
} `xml:"attachment"`
|
||||||
} `xml:"attachments"`
|
} `xml:"attachments"`
|
||||||
Date string `xml:"date"`
|
Date string `xml:"date"`
|
||||||
|
@ -112,8 +112,9 @@ should be enough for the next successful build).`,
|
||||||
if !mimeTypeMap[mimeType] {
|
if !mimeTypeMap[mimeType] {
|
||||||
attachmentsIDs[attachmentID] = true
|
attachmentsIDs[attachmentID] = true
|
||||||
filePath := zAttachment.FindElement("[name()='rdf:resource']").SelectAttr("rdf:resource").Value
|
filePath := zAttachment.FindElement("[name()='rdf:resource']").SelectAttr("rdf:resource").Value
|
||||||
itemAttachments.CreateElement("attachment").CreateElement("path").SetText(filePath)
|
attachment := itemAttachments.CreateElement("attachment")
|
||||||
itemAttachments.CreateElement("attachment").CreateElement("mimeType").SetText(mimeType)
|
attachment.SetText(filePath)
|
||||||
|
attachment.CreateAttr("mimeType", mimeType)
|
||||||
mimeTypeMap[mimeType] = true
|
mimeTypeMap[mimeType] = true
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("DUPLICATE mimeType:", mimeType, attachmentID)
|
fmt.Println("DUPLICATE mimeType:", mimeType, attachmentID)
|
||||||
|
|
Loading…
Reference in New Issue