Well, you're going to have to work on that. All XML parsers are designed to parse exactly one XML document, no more, no less. So you have a stream of XML documents coming in, chopped up into random chunks? If I understand your word "segment" then that's what you have. I can't say I'm impressed by that design but it is what it is.Originally posted by Alasdair Jones:
Thanks, I would if I could. Unfortunately I have no control over the data I will receive and as I said, it will come in segments. Therefore I will have to parse the data before I can determine the message boundaries.
Alasdair: It also will have to cope with incomplete message segments, and segments that span multiple messages.
apigee, a better way to API!
I'll have to do some low-level 'parsing' of my own to repackage the XML segments into whole documents, and only then can I send to an XML parser.
Originally posted by Alasdair Jones:
Using JDOM it unsurprisingly throws a parse exception when it reaches the start of the new message "<?xml..." not expecting another in what it believes is the same document.
apigee, a better way to API!