-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Unexpected characters - even in the simplest scenario #49
Comments
Ok. So, the problem here is that you are feeding the same input twice: first via So: either pass input document in when construction, or feed it in chunks, but not both. The other minor thing is that end marker should be indicated separately from feeding the last byte (otherwise the last byte might not be read). But I don't know if that causes problems here. |
@cowtowncoder can you write correct code for it. I have been trying for a long time and I can find good documentation. |
@AaMalik Same problem here: please read my explanation. It is frustrating to be asked again after fully explaining the issue. And if you do not understand the issue, ask question about which part is specifically problematic. |
Hello,
I am new to the "world" of aalto. Unfortunately, I am not able to make it run as expected - It keeps returning com.fasterxml.aalto.WFCException , even in the simplest scenario (e.g. http://www.cowtowncoder.com/blog/archives/2011/03/entry_451.html this old blog entry).
Here is my code:
byte[] XML = "<tag>Tove</tag>".getBytes();
AsyncXMLInputFactory xmlInputFactory = new InputFactoryImpl();
AsyncXMLStreamReader<AsyncByteArrayFeeder> asyncReader = xmlInputFactory.createAsyncFor(XML);
int inputPtr = 0;
int type;
do {
while ((type = asyncReader.next()) == AsyncXMLStreamReader.EVENT_INCOMPLETE) {
asyncReader.getInputFeeder().feedInput(XML, inputPtr++, 1);
if (inputPtr >= XML.length) {
asyncReader.getInputFeeder().endOfInput();
}
}
System.out.println("Got event of type: "+type);
} while (type != XMLEvent.END_DOCUMENT);
asyncReader.close();
It keeps mi returning:
com.fasterxml.aalto.WFCException: Unexpected character 't' (code 116) in epilog (unbalanced start/end tags?)
Do you know, how to feedInput to the feeder so that no Exception is thrown, please? What do I do wrong?
I utilize com.fasterxml.aalto-xml in the version 1.0.0.
Thank you for any help
The text was updated successfully, but these errors were encountered: