I have an issue where a couple of article galley XML files are not being converted by the eLife Lens Article Viewer. The browser hangs with ‘Loading article’ displayed. Checking the console output I find the following:
lens.js:formatted:109 Uncaught TypeError: Cannot read property ‘getNodes’ of undefined
at s.getHeadings (lens.js:formatted:109)
at Object. (lens.js:formatted:7067)
at fire (VM894 jquery.js:3099)
at Object.fireWith [as resolveWith] (VM894 jquery.js:3211)
at done (VM894 jquery.js:9310)
at XMLHttpRequest.callback (VM894 jquery.js:9720)
Now the strange thing is if I add the two documents in question to an issue galley (as opposed to an article galley), they convert successfully.
I have around 20 other XML files that convert without issue in article galleys.
I’d be grateful for any suggestions as to what the problem may be.
Thanks for your response. Do you know where I can find out which XML nodes are supported? I mentioned that the files transform correctly if added to an issue galley whereas they don’t if added to an article galley. Do you have an idea why that might be?
I haven’t seen the listing of supported nodes anywhere. As far as I remember there are some strict requirements only for elements/node in the article metadata.
This line means that the Lens Viewer tries to retrieve nodes from the element that doesn’t exist. So, on the second look, the problem is not because of an unsupported node but because the node that is required by Lens was missed. You can simply compare this article with another one that renders properly.
Hi
I’ve had this problem too. In my case the files weren’t valide. You can validate in Chrome. The files should also pass the pmc style checker. PMC Style Checker
best
jan
Thanks @Vitaliy and @trace for your responses. I have closely compared the problematic files to files that correctly transform and I’m struggling to see any differences.
ERROR: Missing <copyright-holder>. When an article is under copyright (i.e. it is not in the public domain) we recommend that <copyright-holder> be given.
I think this is a red herring as the error appears on all of the XML documents I’ve validated. I have added the tag to test but it made no difference.
I’ve also run the documents through the PMC style checker and no errors were returned.
It’s not necessary that developers of Lens Viewer complied strictly with JATS XML standards. Have you looked at nodes inside the front element? I guess the best way would be check them one by one.
Thanks @trace for having a look. All of the images in all of the the XML assets in the journal are encoded. None are stored locally. It is just two XML files that are failing to be typeset and all the rest are rendering fine and displaying the encoded images. The file I sent you does typeset correctly and display the encoded images if it is added as an issue galley rather than an article galley. This is what I don’t understand. I’m going to remove the images and see what happens and go over the front element as suggested by Vitaliy with a fine tooth comb. Thanks very much for your time.