zotero / translation-server

A Node.js-based server to run Zotero translators
Other
123 stars 52 forks source link

Incorrect elements order in XPath #83

Closed mrtcode closed 5 years ago

mrtcode commented 5 years ago

While var xpathObject = dom.window.document.evaluate('/html/head/meta', dom.window.document, null, 5, null);

results to the same order as meta tags in the document,

var xpathObject = dom.window.document.evaluate('/html/head/meta/@content', dom.window.document, null, 5, null);

results to reversed order.

The difference is the @content attribute in xpath. And it results to reversed authors in many items translated with EM translator.

The problem doesn't exist when querying the same xpath in browser.

mrtcode commented 5 years ago

Example website: https://www.cell.com/abstract/S0092-8674(11)00581-2