Hi. I have a http Connection that needs to be open and listen to events in realtime. (http stream)
Today i use the reuest function to connect to the stream but my problem is that sometimes the xml comes in chunks and is not valid in the xml node. Now im trying to use DOMParser but can´t make this function to work. I am no expert on this but trying to learn
I think that you will need to watch the stream until you have a valid complete chunk, then you can parse it. So for example, if a chunk of output was wrapped in a <div class="thing">....</div> you would either need to wait for a </div> or better still, wait for another <div class="thing">, then you would know that you could parse the previous div.
But this is all very dependent on a good understanding of the stream. I don't think there is a generic solution.
Anyway, I've not tried anything like this so I might be completely wrong.