Open rossmounce opened 9 years ago
Thanks, This is a problem with peerj who use a weird DTD. There is a norma switch to remove DTDs which should be on by default. Send me an issue - I will try to fix this today - it would have been much easier yesterday.
Are there other journals that should work that I can test on? PLOS ONE perhaps?
Are you sure it's just PeerJ? I just tried PLOS ONE too, same issue:
workshop@crunchbang:~/workshop/test$ getpapers --query 'effects AND JOURNAL:"PLOS ONE" AND FIRST_PDATE:[2015-04-01 TO 2015-04-01]' -x --outdir plosone
#downloads about 125 papers, with XML
workshop@crunchbang:~/workshop/test$ norma -q PMC4382344 -i fulltext.xml -o scholarly.html --transform nlm2html
Error
I/O error reported by XML parser processing null:
/home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
java.lang.RuntimeException: invoke runTransform fails
at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:698)
at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:582)
at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:564)
at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:742)
at org.xmlcml.norma.Norma.run(Norma.java:23)
at org.xmlcml.norma.Norma.main(Norma.java:18)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:696)
... 5 more
Caused by: java.lang.RuntimeException: cannot transform:
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:191)
at org.xmlcml.norma.NormaTransformer.applyXSLDocumentListToCurrentCMDir(NormaTransformer.java:176)
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:94)
at org.xmlcml.norma.NormaArgProcessor.runTransform(NormaArgProcessor.java:214)
... 10 more
Caused by: net.sf.saxon.trans.XPathException: I/O error reported by XML parser processing null: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:467)
at net.sf.saxon.event.Sender.send(Sender.java:171)
at net.sf.saxon.Controller.transform(Controller.java:1690)
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:547)
at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:180)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:167)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:117)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:104)
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:189)
... 13 more
Caused by: java.io.FileNotFoundException: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:440)
... 21 more
Exception in thread "main" java.lang.RuntimeException: cannot process argument: --transform (FileNotFoundException: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory))
at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:586)
at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:564)
at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:742)
at org.xmlcml.norma.Norma.run(Norma.java:23)
at org.xmlcml.norma.Norma.main(Norma.java:18)
workshop@crunchbang:~/workshop/test/plosone$ norma -q PMC438234 -i fulltext.xml -o scholarly.html --transform nlm2html
PMC4382340/ PMC4382341/ PMC4382342/ PMC4382344/
workshop@crunchbang:~/workshop/test/plosone$ norma -q PMC4382344/ -i fulltext.xml -o scholarly.html --transform nlm2html
Error
I/O error reported by XML parser processing null:
/home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
java.lang.RuntimeException: invoke runTransform fails
at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:698)
at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:582)
at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:564)
at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:742)
at org.xmlcml.norma.Norma.run(Norma.java:23)
at org.xmlcml.norma.Norma.main(Norma.java:18)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.xmlcml.cmine.args.DefaultArgProcessor.instantiateAndRunMethod(DefaultArgProcessor.java:696)
... 5 more
Caused by: java.lang.RuntimeException: cannot transform:
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:191)
at org.xmlcml.norma.NormaTransformer.applyXSLDocumentListToCurrentCMDir(NormaTransformer.java:176)
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:94)
at org.xmlcml.norma.NormaArgProcessor.runTransform(NormaArgProcessor.java:214)
... 10 more
Caused by: net.sf.saxon.trans.XPathException: I/O error reported by XML parser processing null: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:467)
at net.sf.saxon.event.Sender.send(Sender.java:171)
at net.sf.saxon.Controller.transform(Controller.java:1690)
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:547)
at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:180)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:167)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:117)
at org.xmlcml.norma.util.TransformerWrapper.transformToXML(TransformerWrapper.java:104)
at org.xmlcml.norma.NormaTransformer.transform(NormaTransformer.java:189)
... 13 more
Caused by: java.io.FileNotFoundException: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:440)
... 21 more
Exception in thread "main" java.lang.RuntimeException: cannot process argument: --transform (FileNotFoundException: /home/workshop/workshop/test/plosone/JATS-archivearticle1.dtd (No such file or directory))
at org.xmlcml.cmine.args.DefaultArgProcessor.runMethodsOfType(DefaultArgProcessor.java:586)
at org.xmlcml.cmine.args.DefaultArgProcessor.runRunMethodsOnChosenArgOptions(DefaultArgProcessor.java:564)
at org.xmlcml.cmine.args.DefaultArgProcessor.runAndOutput(DefaultArgProcessor.java:742)
at org.xmlcml.norma.Norma.run(Norma.java:23)
at org.xmlcml.norma.Norma.main(Norma.java:18)
Version of norma (installed from https://jenkins.ch.cam.ac.uk/view/AMI2/job/norma/ , yesterday at 6pm) Using this in the Neuro workshop VM. Ran getpapers to get 25 peerj papers in valid ctree structure:
Running NORMA old style commands (worked in previous version on norma, but now perhaps depreciated?):
new commands (still not giving desired output, or I'm getting it wrong):