Arvind
Arvind

Reputation: 6474

parsing malformed/incomplete XML in GWT

Is there a library for parsing incomplete XML in GWT?

Because the GWT XML Parser will give an exception, if it is given an incomplete/malformed XML to parse...But I have a scenario in which incomplete XML needs to be parsed. Have you faced such a scenario? How did you solve this problem, in a GWT application?

Upvotes: 2

Views: 2425

Answers (1)

Travis Webb
Travis Webb

Reputation: 15018

"Incomplete XML" is a misnomer. "Incomplete/Malformed XML" is not XML, and therefore no XML parser would be able to parse this any better than a string of random garbage. A given input string is either accepted by a grammar, or it isn't -- computers are strangely binary in that way.

If the XML is incomplete in a perfectly predictable way (e.g. always missing the last character of the file), then you can mend the input string yourself before you parse it. But, in general, this is an unsolvable problem.

Upvotes: 5

Related Questions