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

Unmarshalling file with & symbol in the name. #4

Open
dfoulkes opened this issue Nov 19, 2016 · 4 comments
Open

Unmarshalling file with & symbol in the name. #4

dfoulkes opened this issue Nov 19, 2016 · 4 comments

Comments

@dfoulkes
Copy link

WHEN

ResponseEnvelope envelope = unmarshaller.unmarshal(file);

Parsing ofx file with the following statement transaction:

        	<STMTTRN>
                		<TRNTYPE>DEBIT
                		</TRNTYPE>
                		<DTPOSTED>20161110000044</DTPOSTED>
                		<DTUSER></DTUSER>
                		<TRNAMT>-01.01</TRNAMT>
                		<FITID>17</FITID>
                		<NAME>EE & T-MOBILE            </NAME>
                		<MEMO></MEMO>
                	</STMTTRN>

THEN

Caused by: java.io.IOException: Unexpected EOF
	at net.n3.nanoxml.StdXMLReader.read(Unknown Source)
	at net.n3.nanoxml.XMLUtil.read(Unknown Source)
	at net.n3.nanoxml.ContentReader.read(Unknown Source)
	at net.n3.nanoxml.ContentReaderBackdoor.read(ContentReaderBackdoor.java:24)
	at java.io.Reader.read(Reader.java:140)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.readCharacters(NanoXMLOFXReader.java:186)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:159)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.parseV1FromFirstElement(NanoXMLOFXReader.java:45)
	at com.webcohesion.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:113)
	at com.webcohesion.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:68)
	at com.webcohesion.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:44)
@dfoulkes dfoulkes changed the title Issue Agrogating file with and symbol in the name. Unmarshalling file with & symbol in the name. Nov 19, 2016
@stoicflame
Copy link
Owner

Thanks for the report.

Seems like the next step is to provide a unit test that reproduces the problem so we can validate a fix.

@ProjectFrank
Copy link

This exception is being thrown from the XMLReader itself. It throws this because & is used for escape sequences in XML, so the XML parser is expecting the & to be a part of an escape sequence.

& is itself a character that should be escaped in XML.

Source: https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents

@Luiz-Otavio-Dorigon
Copy link

What is the forecast for this correction?

@stoicflame
Copy link
Owner

I actually can't tell if there's a bug? Shouldn't <NAME>EE & T-MOBILE</NAME> be invalid OFX? Shouldn't it be required to escape it to <NAME>EE &amp; T-MOBILE</NAME>

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

No branches or pull requests

4 participants