ccavanaugh / jgnash

jGnash Personal Finance
http://ccavanaugh.github.io/jgnash/
Other
139 stars 80 forks source link

Import OFX file failed #72

Closed pchurzin closed 5 years ago

pchurzin commented 5 years ago

Expected Behavior

Import of OFX file

Actual Behavior

OFX file is not being parsed.

[2019-01-18 20:03:11] [SEVERE ] {jgnash.convert.importat.ofx.OfxV2Parser parse} javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,15] Message: The value following "version" in the XML declaration must be a quoted string. javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,15] Message: The value following "version" in the XML declaration must be a quoted string. at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:214) at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:184) at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:262) at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:155) at jgnash.convert.importat.ofx.OfxV2Parser.parse(OfxV2Parser.java:262) at jgnash.convert.importat.ofx.OfxV2Parser.parse(OfxV2Parser.java:281) at jgnash.convert.importat.ofx.OfxV2Parser.parse(OfxV2Parser.java:240) at jgnash.convert.importat.ofx.OfxV2Parser.parseFile(OfxV2Parser.java:274) at jgnash.convert.importat.ofx.OfxV2Parser.parse(OfxV2Parser.java:122) at jgnash.uifx.actions.ImportOfxAction$ImportTask.call(ImportOfxAction.java:100) at jgnash.uifx.actions.ImportOfxAction$ImportTask.call(ImportOfxAction.java:86) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:748)

Suspicion

jgnash.convert.importat.ofx.Sanitize.sanitize replaces quotes too much. <?xml version="1.0" encoding="utf-8" ?> transforms to <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> that causes parsing to fail.

Specifications

ccavanaugh commented 5 years ago

Use of an XML declaration in an OFX file is a bit odd and not documented in the standard. Is this coming from a Bank or some other source?

ccavanaugh commented 5 years ago

Fixed for the next release.

Thanks for reporting it.

pchurzin commented 5 years ago

Use of an XML declaration in an OFX file is a bit odd and not documented in the standard. Is this coming from a Bank or some other source?

It was from a bank. I've seen OFX spec at www.ofx.net. But I'm not shure this is a reliable source.