Fix importing Citavi annotations in some cases
This commit is contained in:
parent
0695154661
commit
cff02b04a0
1 changed files with 4 additions and 1 deletions
|
@ -9,6 +9,9 @@ const parseCitavi5Quads = (quadsRaw) => {
|
||||||
const ImportCitaviAnnotatons = async (translation) => {
|
const ImportCitaviAnnotatons = async (translation) => {
|
||||||
const IDMap = translation._itemSaver._IDMap;
|
const IDMap = translation._itemSaver._IDMap;
|
||||||
const ZU = translation._sandboxZotero.Utilities;
|
const ZU = translation._sandboxZotero.Utilities;
|
||||||
|
|
||||||
|
// stream might be closed by now, re-init to make sure getXML() works
|
||||||
|
translation._io.init('xml/dom');
|
||||||
const doc = translation._sandboxZotero.getXML();
|
const doc = translation._sandboxZotero.getXML();
|
||||||
const isCitavi5 = ZU.xpathText(doc, '//CitaviExchangeData/@Version').startsWith('5');
|
const isCitavi5 = ZU.xpathText(doc, '//CitaviExchangeData/@Version').startsWith('5');
|
||||||
var annotationNodes = ZU.xpath(doc, '//Annotations/Annotation');
|
var annotationNodes = ZU.xpath(doc, '//Annotations/Annotation');
|
||||||
|
@ -29,7 +32,7 @@ const ImportCitaviAnnotatons = async (translation) => {
|
||||||
const stageProgress = 50;
|
const stageProgress = 50;
|
||||||
let progress = baseProgress;
|
let progress = baseProgress;
|
||||||
translation.getProgress = () => progress;
|
translation.getProgress = () => progress;
|
||||||
|
|
||||||
for (var i = 0, n = annotationNodes.length; i < n; i++) {
|
for (var i = 0, n = annotationNodes.length; i < n; i++) {
|
||||||
const id = ZU.xpathText(annotationNodes[i], '@id');
|
const id = ZU.xpathText(annotationNodes[i], '@id');
|
||||||
const quadsRaw = ZU.xpathText(annotationNodes[i], './Quads');
|
const quadsRaw = ZU.xpathText(annotationNodes[i], './Quads');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue