LMD VCL - XML

From LMD
Jump to: navigation, search

<< Back to Getting started or Product Resources page

[edit]

Native with DOM like API

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

Tables of names

In LMDXML engine the tables of name approach is used. It's a just list of strings for of which each item is assigned an unique (in bounds of table) number. Link to such table is included in each document. Elements are not stored to a string, but to an unique number of the table. The same is true for attributes.

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

At second - it increases searching speed dramatically, because comparing of numbers is much faster than comparing strings.

Interfaces or Classes?

The LMDXML engine implements all objects as interfaces (interface keyword instead of class). Technical background is that working with interfaces is much safer and simpler than working with object 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

Represents binary representation of XML format. You can use it to store configuration files, because it compact, fast and typed. LMDXML engine can make use of both ways: Classic text XML and binary XML.