[
https://issues.apache.org/jira/browse/OLINGO-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13834852#comment-13834852
]
Christian Amend commented on OLINGO-73:
---------------------------------------
Hi Aki,
thanks for your input!
Did I understand correctly that the method getText() does not always deliver
the whole text of an element? This is not something I would expect when calling
a method thats calleed like that. I would expect that if I have something like
<id>1234</id> the method getText when I am at the id element always delivers
1234 and not only 123. See our code below.
Our code example:
reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005,
FormatXml.ATOM_ID);
reader.next();
if (reader.isCharacters()) {
entryMetadata.setId(reader.getText());
}
reader.nextTag();
reader.require(XMLStreamConstants.END_ELEMENT, Edm.NAMESPACE_ATOM_2005,
FormatXml.ATOM_ID);
> Woodstox parser fails for big files sometimes
> ---------------------------------------------
>
> Key: OLINGO-73
> URL: https://issues.apache.org/jira/browse/OLINGO-73
> Project: Olingo
> Issue Type: Bug
> Components: odata2-core
> Affects Versions: V2 1.0.0
> Reporter: Christian Amend
> Assignee: Christian Amend
> Fix For: V2 1.1.0
>
>
> For some big xml files the woodstox parser which is a transitive dependency
> of cxf fails with the exception: "Found characters or cdata event when not
> expected"
> This happens because a previous call of getText() doesn´t deliver the whole
> text but only a fraction. So when we call nextTag() the parser throws the
> exception because there is still character data on the buffer. This issue
> does only appear with big xml files and happens randomly within the document
> altough always at the same element.
> So maybe this is a woodstox bug. We can implement a workaround by calling
> getText() as long as there is still character data left.
--
This message was sent by Atlassian JIRA
(v6.1#6144)