miachm / SODS

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)
The Unlicense
74 stars 30 forks source link

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. #80

Closed tan9 closed 1 year ago

tan9 commented 1 year ago

When woodstox was in the classpath (or deployed to JBoss EAP application server), SDOS encountered an issue outputting attributes with namespaces, such as "office:version".

Here's the complete exception stack trace:

Tests run: 185, Failures: 5, Errors: 0, Skipped: 0, Time elapsed: 6.205 sec <<< FAILURE!
testWriteBoolean(com.github.miachm.sods.OfficeValueTypeTest)  Time elapsed: 0.565 sec  <<< FAILURE!
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkDOMNSErr(CoreDocumentImpl.java:2546)
    at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:117)
    at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:78)
    at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2163)
    at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(ElementImpl.java:659)
    at com.ctc.wstx.dom.DOMOutputElement.addAttribute(DOMOutputElement.java:210)
    at com.ctc.wstx.dom.WstxDOMWrappingWriter.outputAttribute(WstxDOMWrappingWriter.java:561)
    at com.ctc.wstx.dom.WstxDOMWrappingWriter.writeAttribute(WstxDOMWrappingWriter.java:251)
    at com.github.miachm.sods.OfficeValueType$1.write(OfficeValueType.java:41)
    at com.github.miachm.sods.OfficeValueTypeTest.lambda$assertWrite$0(OfficeValueTypeTest.java:217)
    at com.github.miachm.sods.OfficeValueTypeTest$NodeAssert.of(OfficeValueTypeTest.java:286)
    at com.github.miachm.sods.OfficeValueTypeTest.assertWrite(OfficeValueTypeTest.java:214)
    at com.github.miachm.sods.OfficeValueTypeTest.testWriteBoolean(OfficeValueTypeTest.java:60)

Refer to https://github.com/miachm/SODS/pull/78/checks