Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for latest Twiner #42

Closed
mrombout opened this issue Jan 17, 2018 · 2 comments · Fixed by #45
Closed

Add support for latest Twiner #42

mrombout opened this issue Jan 17, 2018 · 2 comments · Fixed by #45
Assignees
Labels

Comments

@mrombout
Copy link
Owner

mrombout commented Jan 17, 2018

Spiner is no longer able to transform stories from the latest Twine version. It looks like tw-storydata changed and now has a zoom, which Spiner doesn't like. There is also size on tw-passagedata.

22:14:16.126 [JavaFX Application Thread] ERROR nl.mikero.spiner.frontend.main.ApplicationView - Could not transform document.
nl.mikero.spiner.core.exception.TwineTransformationFailedException: Could not transform input.
        at nl.mikero.spiner.core.transformer.TransformService.transform(TransformService.java:70)
        at nl.mikero.spiner.frontend.TransformTask.call(TransformTask.java:44)
        at nl.mikero.spiner.frontend.TransformTask.call(TransformTask.java:14)
        at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: nl.mikero.spiner.core.exception.TwineParseFailedException: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 212; cvc-complex-type.3.2.2: Attribute 'zoom' is not allowed to appear in element 'tw-storydata'.]
        at nl.mikero.spiner.core.twine.TwineArchiveParser.parse(TwineArchiveParser.java:43)
        at nl.mikero.spiner.core.transformer.TransformService.parse(TransformService.java:112)
        at nl.mikero.spiner.core.transformer.TransformService.transform(TransformService.java:65)
        ... 5 common frames omitted
Caused by: javax.xml.bind.UnmarshalException: null
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at nl.mikero.spiner.core.twine.TwineArchiveParser.parse(TwineArchiveParser.java:40)
        ... 7 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'zoom' is not allowed to appear in element 'tw-storydata'.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        ... 12 common frames omitted
no warnings or errors were found
22:17:57.356 [JavaFX Application Thread] ERROR nl.mikero.spiner.frontend.main.ApplicationView - Could not transform document.
nl.mikero.spiner.core.exception.TwineTransformationFailedException: Could not transform input.
        at nl.mikero.spiner.core.transformer.TransformService.transform(TransformService.java:70)
        at nl.mikero.spiner.frontend.TransformTask.call(TransformTask.java:44)
        at nl.mikero.spiner.frontend.TransformTask.call(TransformTask.java:14)
        at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: nl.mikero.spiner.core.exception.TwineParseFailedException: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 212; cvc-complex-type.3.2.2: Attribute 'zoom' is not allowed to appear in element 'tw-storydata'.]
        at nl.mikero.spiner.core.twine.TwineArchiveParser.parse(TwineArchiveParser.java:43)
        at nl.mikero.spiner.core.transformer.TransformService.parse(TransformService.java:112)
        at nl.mikero.spiner.core.transformer.TransformService.transform(TransformService.java:65)
        ... 5 common frames omitted
Caused by: javax.xml.bind.UnmarshalException: null
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at nl.mikero.spiner.core.twine.TwineArchiveParser.parse(TwineArchiveParser.java:40)
        ... 7 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'zoom' is not allowed to appear in element 'tw-storydata'.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(Unknown Source)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        ... 12 common frames omitted
@mrombout
Copy link
Owner Author

mrombout commented Jan 17, 2018

After removing the zoom and size attributes from the element the EPUB could be created, though after a quick look in SumatraPDF the links appeared to be broken.

@mrombout mrombout mentioned this issue Jan 17, 2018
@mrombout mrombout self-assigned this Jan 18, 2018
@mrombout
Copy link
Owner Author

So far I've updated the transformation process to work for Twine 2.2.1. I did run into a (possibly) unrelated issue where the pages were not being rendered on the Kobo Touch. I haven't found a confirmed cause yet, but the output seems to contain an empty xmlns="" on the HTML tag which is not allowed according to this EPUB validator: http://validator.idpf.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant