Simplicity VTD-XML




1 simplicity

1.1 parser
1.2 indexer
1.3 xml content modifier
1.4 xml slicer/splitter/assembler
1.5 xml editor/eraser
1.6 other benefits





simplicity
as parser

when used in parsing mode, vtd-xml general purpose, extremely high performance xml parser compares favorably others:



vtd-xml typically outperforms sax (with null content handler) while still providing full random access , built-in xpath support.
vtd-xml typically consumes 1.3-1.5 times xml document s size in memory, 1/5 memory usage of dom
applications written in vtd-xml shorter , cleaner dom or sax versions.

as indexer

because of inherent persistence of vtd-xml, developers can write internal representation of parsed xml document disk , later reload avoid repetitive parsing. end, ximpleware has introduced vtd+xml binary packaging format combining vtd, lc , xml text. can typically viewed in 1 of following 2 ways:



a native xml index eliminates parsing cost , retains benefits of xml. file format human readable , backward compatible xml.
a binary xml format uses binary data enhance processing of xml text.

xml content modifier

because vtd-xml keeps xml text intact without decoding, when application intends modify content of xml needs modify portions relevant changes. in stark contrast dom, sax, or stax parsing, incur cost of parsing , re-serialization no matter how small changes are.


since vtds refer document elements offsets, changes length of elements occurring earlier in document require adjustments vtds referring later elements. however, adjustments integer additions, albeit many integers in multiple tables, quick.


xml slicer/splitter/assembler

an application based on vtd-xml can use offsets , lengths address tokens, or element fragments. allows xml documents manipulated arrays of bytes.



as slicer, vtd-xml can slice off token or element fragment xml document, insert location in same document, or different document.
as splitter, vtd-xml can split sub-elements in xml document , dump each separate xml document.
as assembler, vtd-xml can cut chunks out of multiple xml documents , assemble them new xml document.

xml editor/eraser

used editor/eraser, vtd-xml can directly edit/erase underlying byte content of xml text, provided token length wider intended new content. immediate benefit of approach application can reuse original vtd , lc. in contrast, when using vtd-xml incrementally update xml document, application needs reparse updated document before application can process it.


an editor can made smart enough track location of each token, permitting new, longer tokens replace existing, shorter tokens merely addressing new token in separate memory outside used store original document. likewise, when reordering document, element text not need copied; lcs need updated. when complete, contiguous xml document needed, such when saving it, disparate parts can reassembled new, contiguous document.


other benefits

vtd-xml pioneers non-blocking, stateless xpath evaluation approach.








Comments