I have a file that has several XML documents like below in sequence.
<?xml version="1.0"?><Node>...<Node>...</Node>...</Node><?xml version...
which repeats several times.
I use Java, I have a FileChannel opened for the file and I have a byte buffer to read. Would appreciate if there is a built in way or an easier way or an already solved way to do a partial parsing of XML bytes with Java. For example like this:
FooParser parser = new FooParser();
while (...)
{
buffer.flip();
parser.parse(buffer);
buffer.compact();
if (parser.done())
{
xmlDocs.add(parser.xml());
parser.reset();
}
file.read(buffer);
...
}