Project

Profile

Help

I/O error reported by XML parser processing file when running XSLT (Saxon PE 9.8.0.4J)

Added by Rick Schoen about 3 years ago

We are beginning the process of migrating from a lightly-modified version of the NLM Journalpublishing 3.0 DTD to a lightly-modified version of the JATS v1.2 DTD for our in-house editing and processing. I have been working on the initial setup and testing of our editing and document processing tools. We have 4 XSLT transformations that are used during various parts of the production process. We are using Saxon PE 9.8.0.4J to run our transformations on a Linux server.

When I run our command:

ng net.sf.saxon.Transform -xsl:/develop/lib/code/verify/verify.xsl -s:/jrnls/AN/v000n000/59613/59613.tmp -o:/jrnls/AN/v000n000/59613/59613.xml -catalog:/develop/lib/code/saxon_JATS-1.2/catalog.ucpj-jats.xml -config:/opt/SaxonPE9-8-0-4J/UCPJconfig.xml ms-directory=/jrnls/AN/v000n000/59613

I get this error:

I/O error reported by XML parser processing file:/jrnls/AN/v000n000/59613/59613.tmp: /jrnls/AN/v000n000/59613/JATS-journalpublishing-oasis-article1-mathml3.dtd (No such file or directory)

And if I run the command with '-t', I get this response:

Saxon-PE 9.8.0.4J from Saxonica
Java version 1.8.0_272
Using license serial number XXXXXXX
Stylesheet compilation time: 87.553897ms
Processing file:/jrnls/AN/v000n000/59613/59613.tmp
Using parser org.apache.xml.resolver.tools.ResolvingXMLReader
Building tree for file:/jrnls/AN/v000n000/59613/59613.tmp using class net.sf.saxon.tree.tiny.TinyBuilder
I/O error reported by XML parser processing file:/jrnls/AN/v000n000/59613/59613.tmp: /jrnls/AN/v000n000/59613/JATS-journalpublishing-oasis-article1-mathml3.dtd (No such file or directory)
Feb 18, 2021 3:34:52 PM com.martiansoftware.nailgun.NGSession run
INFO: Nail cleanly exited with status 2

We are using an almost identical command line for processing our current files in the Journalpublishing 3.0 DTD but using a different catalog file. We are having no problems with processing our current files.

I used our Journalpublishing 3.0 catalog file as an example when I setup the JATS 1.2 catalog file. I've tried using the JATS 1.2 catalog both without a element and with a element with the xml:base attribute specified. I got the same result either way.

I did setup a framework in Oxygen to test this XSLT and it works as expected.

Can anyone suggest any solutions to this problem? Any advice would greatly appreciated.


Replies (2)

RE: I/O error reported by XML parser processing file when running XSLT (Saxon PE 9.8.0.4J) - Added by Michael Kay about 3 years ago

Very hard to give much help on this, because (a) it's very dependent on your filestore configuration, and (b) Saxon isn't detecting the error, it's only passing the message on.

Have you switched on all the available diagnostic switches for the catalog resolver?

Michael Kay Saxonica

RE: I/O error reported by XML parser processing file when running XSLT (Saxon PE 9.8.0.4J) - Added by Rick Schoen about 3 years ago

I found the problem and the solution.

I googled “xerces resolver.jar" and one of the results was to the Apache XML Project Resolver Overview page (https://xerces.apache.org/xml-commons/components/resolver/). From there I went to “XML Entity and URI Resolvers” (https://xerces.apache.org/xml-commons/components/resolver/resolver-article.html).

In the first footnote on that page, the author includes a command line for parsing an XML file with a catalog:

$ java org.apache.xml.resolver.apps.xparse -d 2 -c catalog.xml example.xml

Which I modified to run on our server:

% ng org.apache.xml.resolver.apps.xparse -d 2 -c /develop/lib/code/saxon_JATS-1.2/catalog.ucpj-jats.xml /jrnls/AN/v000n000/59613/59613.xml

I got this output:

Attempting validating, namespace-aware parse
Loading catalog: /develop/lib/code/saxon_JATS-1.2/catalog.ucpj-jats.xml
Resolved public: -//NLM//DTD JATS (Z39.96) Journal Publishing DTD with OASIS Tables with MathML3 v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalpublishing-oasis-article1-mathml3.dtd
Resolved public: -//NLM//DTD JATS (Z39.96) Journal Publishing DTD with OASIS Tables DTD-Specific Modules v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalpub-oasis-custom-modules1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS MathML 3.0 Modules v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-mathml3-modules1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Module of Modules v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-modules1.ent
Resolved public: -//NLM//DTD JATS ALI Namespace Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-ali-namespace1.ent
Resolved public: -//NLM//DTD JATS OASIS Table Namespace Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-oasis-namespace1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Common Attributes (for all elements) v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-common-atts1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Journal Publishing DTD with OASIS Tables Customize Classes v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalpub-oasis-custom-classes1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Default Element Classes Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-default-classes1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Journal Publishing DTD Customize Mixes Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalpubcustom-mixes1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Default Element Mixes Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-default-mixes1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Journal Publishing DTD Customize Content and Attributes Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalpubcustom-models1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Common (Shared) Elements Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-common1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Journal Article Metadata Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-articlemeta1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Back Matter Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-backmatter1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Display Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-display1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Formatting Element Classes v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-format1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Funding Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-funding1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Journal Metadata Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-journalmeta1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Link Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-link1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite List Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-list1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Math Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-math1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) NLM Citation v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-nlmcitation1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) Namespaced OASIS XML Table Setup Module v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-oasis-tablesetup1.ent
Resolved public: -//OASIS//DTD XML Exchange Table Model 19990315//EN
        file:/develop/lib/code/saxon_JATS-1.2/oasis-exchange.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Paragraph-Like Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-para1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Subject Phrase Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-phrase1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Bibliographic Reference (Citation) Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-references1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Related Object Element v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-related-object1.ent
Resolved public: -//NLM//DTD JATS (Z39.96) JATS DTD Suite Section Class Elements v1.2 20190208//EN
        file:/develop/lib/code/saxon_JATS-1.2/JATS-section1.ent
java.io.FileNotFoundException: /develop/lib/code/saxon_JATS-1.2/BITS-embedded-index2.ent (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:623)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1304)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1240)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:740)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2109)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2072)
        at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSubset(XMLDTDScannerImpl.java:307)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1174)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1045)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:959)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1140)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:655)
        at org.apache.xml.resolver.tools.ResolvingParser.parse(ResolvingParser.java:183)
        at org.apache.xml.resolver.apps.xparse.main(xparse.java:186)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.martiansoftware.nailgun.NGSession.run(NGSession.java:278)
Parse succeeded (0.31) with no errors and no warnings.

Once I restored that missing file and added it to our catalog file, our command line worked as expected.

    (1-2/2)

    Please register to reply