The XML declaration, with the single quotes, looks a lot like this question on SO:
https://stackoverflow.com/questions/43754776/java-transformer-adding-spaces-and-single-quotes-to-xml-header-and-not-encoding The specific class generating the XML is org.apache.poi.openxml4j.opc.StreamHelper, via a javax.xml.transform.Transformer created from javax.xml.transform.TransformerFactory.newInstance().newTransformer() In my environment at least, this comes directly from rt.jar, no extra libraries needed. However, if some library in your environment is setting a different one, that could be the cause. Can you see which concrete class is returned by that static method? On Thu, Sep 7, 2017 at 9:43 AM Seb Duggan <[email protected]> wrote: > Yes, they are identical... > > > On 7 September 2017 at 16:24:27, Javen O'Neal ([email protected]) > wrote: > > > xmlparserv2.jar > Did you compare the hashes of these jars to verify they truly are the same? > > On Sep 7, 2017 04:34, "Seb Duggan" <[email protected]> wrote: > > Thanks Nick. > > Both staging and live are using "oracle.xml.jaxp.JXSAXParserFactory" from > exactly the same version of xmlparserv2.jar - but one works, while the > other doesn't. > > Locally, I'm using "org.apache.xerces.jaxp.SAXParserFactoryImpl", from > apache-xml-xerces.jar - which works. > > Both jars are available on all environments - where might any setting of > the default be taking place? This is on Tomcat; nothing seems to be > specified in sentenv.sh... > > > Seb > > > > On 7 September 2017 at 11:40:07, Nick Burch ([email protected]) wrote: > > On Thu, 7 Sep 2017, Seb Duggan wrote: > > Notice the differences in the first two lines... > > > > There is a minimal difference in the Java version on the servers: my > local > > computer is running 1.8.0_112, staging is running 1.8.0_45, and live > > (producing the corrupt files) is on 1.8.0_66. All are Oracle 64-bit. > > > > Can anyone think of what might be causing the difference in output > between > > the servers? I've been banging my head against this now for a couple of > > days! > > My best guess is that on production, you have deliberately or accidentally > configured in a different (likely older / less functional) XML library as > your JVM-default XML handler > > I'd suggest doing something like "SAXParserFactory.newInstance();" then > checking what class you got + which jar that class came from. My hunch is > they won't be the same on both servers, and likely won't be what you > wanted / expected on your broken server! > > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
