As parser When used in parsing mode, VTD-XML is a general purpose, high performance XML parser which compares favorably with others: • VTD-XML typically outperforms SAX (with NULL content handler) while still providing full random access and built-in
XPath support. • VTD-XML typically consumes 1.3-1.5 times the XML document's size in memory, which is about 1/5 the memory usage of DOM • Applications written in VTD-XML are usually much shorter and cleaner than their DOM or SAX versions.
As indexer Because of the inherent persistence of VTD-XML, developers can write the internal representation of a parsed XML document to disk and later reload it to avoid repetitive parsing. To this end, XimpleWare has introduced
VTD+XML as a binary packaging format combining VTD, LC and the XML text. It can typically be viewed in one of the following two ways: • A native XML index that completely eliminates the parsing cost and also retains all benefits of XML. It is a file format that is human readable and
backward compatible with XML. • A
binary XML format that uses binary data to enhance the processing of the XML text.
XML content modifier Because VTD-XML keeps the XML text intact without decoding, when an application intends to modify the content of XML it only needs to modify the portions most relevant to the changes. This is in stark contrast with DOM, SAX, or StAx parsing, which incur the cost of parsing and re-serialization no matter how small the changes are. Since VTDs refer to document elements by their offsets, changes to the length of elements occurring earlier in a document require adjustments to VTDs referring to all later elements. However, those adjustments are integer additions, albeit to many integers in multiple tables, so they are quick.
XML slicer/splitter/assembler An application based on VTD-XML can also use offsets and lengths to address tokens, or element fragments. This allows XML documents to be manipulated like arrays of bytes. • As a slicer, VTD-XML can "
slice" off a token or an element fragment from an XML document, then insert it back into another location in the same document, or into a different document. • As a splitter, VTD-XML can
split sub-elements in an XML document and dump each into a separate XML document. • As an assembler, VTD-XML can "
cut" chunks out of multiple XML documents and
assemble them into a new XML document.
XML editor/eraser Used as an editor/eraser, VTD-XML can directly edit/erase the underlying byte content of the XML text, provided that the token length is wider than the intended new content. An immediate benefit of this approach is that the application can immediately reuse the original VTD and LC. In contrast, when using VTD-XML to incrementally update an XML document, an application needs to reparse the updated document before the application can process it. An editor can be made smart enough to track the location of each token, permitting new, longer tokens to replace existing, shorter tokens by merely addressing the new token in separate memory outside that used to store the original document. Likewise, when reordering the document, element text does not need to be copied; only the LCs need to be updated. When a complete, contiguous XML document is needed, such as when saving it, the disparate parts can be reassembled into a new, contiguous document.
Other benefits VTD-XML also pioneers the non-blocking, stateless XPath evaluation approach. ==Weaknesses==