LMD VCL - XML

From LMD
Revision as of 16:01, 21 February 2008 by Fduch (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Key features of LMDXML

Native with DOM like API

LMDXML is pure pascal, fast and small library to parse XML files.

Tables of names

In LMDXML implementing is used тАЬtables of namesтАЭ idea. It's a just list of strings for each of them is assigned unique (in bounds of table) number. Link to such table included in each document. And for elements are stored not a strings, but unique numbers from table. The same is actual for attributes.

What for?

Firstly, it helps to decrease memory usage, especially for huge documents. We don't need to store thousands strings, just thousands numbers (number don't require memory reserving and use less memory).

Secondly, it increase searching speed dramatically, because comparing of number is much faster than comparing strings.

Interfaces or Classes?

LMDXML all objects are represented as interfaces (interface keyword instead of class). Reason is that work with interfaces much safer and simpler than with objects referencing. You needn't to create complex code with try...finally to destroy objects тАУ it will be done by compiler RTL for you. See examples.

BinaryXML format

It's binary representation of XML format. You can use it to store config files, because it compact, fast and typed. LMDXML can uses both of classic text XML and binary XML.