I am trying to get the original XML out of a VTD+XML bytearray but I'm getting the wrong data. The output of dumpXML() has what appears to be data from the index tacked on to the front. Here's the example code:
//Build VTD+XML index
VTDGen gen = new VTDGen();
VTDNav nav = gen.getNav();
ByteArrayOutputStream os = new ByteArrayOutputStream();
//Get original XML
ByteArrayOutputStream osOrig = new ByteArrayOutputStream();
//Load VTD+XML into new Gen
VTDGen gen2 = new VTDGen();
VTDNav nav2 = gen2.loadIndex(os.toByteArray());
//Attempt to get original XML
ByteArrayOutputStream os2 = new ByteArrayOutputStream();
At this point osOrig and os2 should contain the same content, right? However osOrig is correct, but os2 has characters tacked on to the front. What am I doing wrong?
Also: I'm using version 2.3
hmm.. it may be a bug, let me investigate and get back..
It is a bug and the fix (java version) has been checked in ...
Will we get a new version?
Sorry, but I 'm new to this forum.
I see the same issue in v2.4
This issue has been fixed you just have to go to VTD-XML CVS repository to check out the latest update...
please post directly to vtd-xml-users mailing list if you need further instruction...