G
ginguene
I am sending continuous stream of XML like this :
_____________________
<stream>
<balise>
test
</balise>
<balise>
test2
</balise>
[..........etc..]
</stream>
_____________________
as reading this stream (in a string builder), i need to extract the
<balise> tag in order to get this :
<balise>
test
</balise>
and remove it from the stream as we parse
exemple :
_____________________
<stream>
<balise>
test
</balise>
<balise> [waiting for the rest of the stream...]
_____________________
with this in the stream, we should extract :
<balise>
test
</balise>
so at the end we have :
_____________________
<stream>
<balise> [waiting for the rest of the stream...]
_____________________
And so on as we read the stream !
The thing is, i can receive this stream byte after byte, or more...
Currently, i am using RegEx.
But its a bit tricky with the CDATA
For exemple if we have something like this in our stream :
<balise ><![CDATA[<balise ></balise >
We should be waiting for the real end of <balise >, but i cant do it
with regex (or you have tips maybe ?)
So i thought maybe using some XMLreader, or xmlstreamreader or
whatever...
I need the fastest processing solution
Thanks
_____________________
<stream>
<balise>
test
</balise>
<balise>
test2
</balise>
[..........etc..]
</stream>
_____________________
as reading this stream (in a string builder), i need to extract the
<balise> tag in order to get this :
<balise>
test
</balise>
and remove it from the stream as we parse
exemple :
_____________________
<stream>
<balise>
test
</balise>
<balise> [waiting for the rest of the stream...]
_____________________
with this in the stream, we should extract :
<balise>
test
</balise>
so at the end we have :
_____________________
<stream>
<balise> [waiting for the rest of the stream...]
_____________________
And so on as we read the stream !
The thing is, i can receive this stream byte after byte, or more...
Currently, i am using RegEx.
But its a bit tricky with the CDATA
For exemple if we have something like this in our stream :
<balise ><![CDATA[<balise ></balise >
We should be waiting for the real end of <balise >, but i cant do it
with regex (or you have tips maybe ?)
So i thought maybe using some XMLreader, or xmlstreamreader or
whatever...
I need the fastest processing solution
Thanks